Skip to main content
Images are a creation primitive in Naive API v2. Two tools cover what an agent typically needs: AI image generation for original visuals (FLUX, Stable Diffusion, Recraft), and stock photo search for free, license-clean photography. Both are identity-aware and billing-integrated.

CLI First

Tools

ToolTypeDescriptionCost
generate_imagesCoreGenerate images from a text prompt (async)Dynamic (model-dependent)
stock_searchCoreSearch free stock photosFree
image_modelsCoreList all available image generation models with parametersFree
image_statusCoreCheck status of an image generation jobFree

Generating Images

The generate_images tool submits an async image generation job. The input object supports any model-specific parameters.
Response (202):

Parameters (Common)

ParamTypeRequiredDefaultDescription
promptstringYesText description of the image
image_sizestringNosquare_hdsquare_hd, landscape_4_3, landscape_16_9, portrait_4_3, portrait_16_9
num_imagesnumberNo1Number of images (1-4)
seednumberNoRandomReproducibility seed
guidance_scalenumberNo3.5CFG guidance (FLUX Schnell/Dev only)
num_inference_stepsnumberNo4Quality steps (FLUX Schnell: 1-12)
output_formatstringNojpeg"jpeg" or "png"
FLUX Pro v1.1 does NOT support guidance_scale or num_inference_steps. Use FLUX Schnell or Dev if you need these.

Checking Status

Poll until the job completes:
Response (completed):

Cost

Image generation pricing is dynamic — based on the model’s per-unit cost, converted to credits at $0.05/credit. Preview costs before submitting:

Available Models

Use GET /v1/images/models to see the full dynamically-fetched list. Common models:
ModelModeBest For
fal-ai/flux/schnelltext-to-imageFast generation (~5s), good default
fal-ai/flux-pro/v1.1text-to-imageHighest quality (~15s)
fal-ai/flux/devtext-to-imageExperimental, supports guidance
fal-ai/flux-realismtext-to-imagePhotorealistic results
fal-ai/recraft-v3text-to-imageDesign-focused (logos, illustrations)
fal-ai/stable-diffusion-v35-largetext-to-imageClassic SD with negative prompts
Search free stock photos — no credits charged, no generation wait.
Response:

Parameters

ParamTypeRequiredDefaultDescription
querystringYesSearch keywords
countnumberNo10Results count (1-80)
orientationstringNolandscape, portrait, or square
colorstringNoFilter by dominant color
sizestringNoMinimum size: large, medium, small

Prompt Tips

For logos, always specify “no text” and “white background”. Text in AI-generated images is often garbled. Add text separately.

Error Handling

ErrorCauseRecovery
insufficient_creditsNot enough credits for generationPreview cost with /v1/images/pricing, then top up
provider_errorAI model provider rejected the requestCheck model parameters against /v1/images/models
invalid_modelModel ID not recognizedUse GET /v1/images/models for valid IDs

When to Use Each

NeedToolWhy
Custom branded visualsgenerate_imagesUnique content matching your brand
Logo or icon conceptsgenerate_imagesNo stock option for custom marks
Generic backgroundsstock_searchFast, free, high quality
Social media photosstock_searchProfessional, free, immediate

Typical Workflow