image-polaroid-userImage Generation

Generate Image

post

Generates images from text prompts. Supports OpenAI models and Leonardo AI models.

OpenAI models (gpt-image-1, gpt-image-1-mini, dall-e-2, dall-e-3) respond synchronously — the image URL is returned directly.

Leonardo models (leonardo/...) respond asynchronously — the response contains a taskId. To retrieve the image, poll POST /api/v1/getAsyncResponse with the taskId:

{ "taskId": "leo_abc123xyz" }

Poll every few seconds until the status is succeed, then use the returned image URL.

Authorizations
AuthorizationstringRequired

FastRouter API Key. Get yours at https://fastrouter.ai

Format: Authorization: Bearer YOUR_API_KEY

Body
promptstringRequired

Text description of the desired image

Example: A cute baby sea otter wearing a beret
modelstring · enumRequired

Image generation model to use. OpenAI models return images synchronously. Leonardo models (leonardo/...) return a taskId — poll POST /api/v1/getAsyncResponse to retrieve the result.

Example: openai/gpt-image-1Possible values:
ninteger · min: 1 · max: 10 · nullableOptional

Number of images to generate. Note: Only n=1 is supported for dall-e-3

Default: 1
sizestring · nullableOptional

Image dimensions. Supported values vary by model:

  • gpt-image-1/mini: auto, 1024×1024, 1536×1024, 1024×1536
  • dall-e-2: 256×256, 512×512, 1024×1024
  • dall-e-3: 1024×1024, 1792×1024, 1024×1792
Default: autoExample: 1024x1024
qualitystring · enum · nullableOptional

Image quality level:

  • gpt-image-1/mini: auto, high, medium, low
  • dall-e-3: auto, hd, standard
  • dall-e-2: standard only
Default: autoPossible values:
output_formatstring · enum · nullableOptional

Output image format. Only supported for gpt-image-1 and gpt-image-1-mini

Default: pngPossible values:
backgroundstring · enum · nullableOptional

Background style. Only for gpt-image-1 and gpt-image-1-mini. Note: transparent requires png or webp format

Default: autoPossible values:
stylestring · enumOptional

Image style (DALL-E 3 only)

Default: vividPossible values:
response_formatstring · enumOptional

Format of the response data

Default: urlPossible values:
Responses
chevron-right
200

Successful response. For OpenAI models: image URL returned directly. For Leonardo models: taskId returned — poll POST /api/v1/getAsyncResponse to retrieve the image once ready.

application/json
createdintegerOptional

Unix timestamp of when the image was created

post
/api/v1/images/generations

Last updated