Image Generation
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
Text description of the desired image
A cute baby sea otter wearing a beretImage generation model to use.
Models may support synchronous or asynchronous execution depending on the available providers.
If response_type is omitted, FastRouter automatically selects the best available provider, preferring synchronous execution and falling back to asynchronous when necessary.
Call GET /api/v1/models for the latest supported models.
openai/gpt-image-1Possible values: Controls how the image generation request is processed.
sync— Force a synchronous provider. The generated image is returned directly in the response.async— Force an asynchronous provider. The response returns ataskId; retrieve the completed image using GET /api/v1/images/{task_id} or POST /api/v1/getAsyncResponse.- Omit this field to let FastRouter automatically select the best provider, preferring synchronous execution and falling back to asynchronous when necessary.
Number of images to generate. Supported range varies by model.
1Image dimensions. Supported values vary by model, e.g. gpt-image-1/mini: auto, 1024×1024, 1536×1024, 1024×1536. Check GET /api/v1/models for per-model supported sizes.
autoExample: 1024x1024Image quality level (model-specific), e.g. gpt-image-1/mini: auto, high, medium, low. Check GET /api/v1/models for per-model supported values.
autoPossible values: Output image format. Only supported for gpt-image-1 and gpt-image-1-mini
pngPossible values: Background style. Only for gpt-image-1 and gpt-image-1-mini. Note: transparent requires png or webp format
autoPossible values: Image style, where supported by the model.
vividPossible values: Format of the response data
urlPossible values: Successful response.
If the request is processed synchronously, the generated image (URL or base64) is returned directly.
If the request is processed asynchronously, the response contains a taskId. Poll GET /api/v1/images/{task_id} or POST /api/v1/getAsyncResponse until the image is ready.
Bad Request - Invalid parameters
Unauthorized - Invalid API key
Rate Limit Exceeded
Internal Server Error
Note: Leonardo models (leonardo/...) respond asynchronously and return a taskId. Retrieve the completed image by polling the async response endpoint using either the GET or POST method.
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
The task ID returned from POST /api/v1/images/generations (e.g. a Leonardo leo_ prefixed ID).
leo_22c6720f-75c9-4cdb-ba72-5a6ac6ed0d31Image generation status / result
FastRouter transaction ID for this generation.
Unix timestamp when the image was created.
Image dimensions.
1024x1024Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.
Note: the 401 error body uses code, message, param, and type (there is no status field), and type is invalid_request_error.
Task not found or expired
Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.
Internal Server Error
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
The taskId returned from POST /api/v1/videos. When it includes a provider prefix (e.g. pol_ for Pollo), model can be omitted.
pol_cmm22zlht0bqsc5uw50j8aw5qThe video model used in the original /videos request. Required when taskId has no provider prefix; optional when taskId has a provider prefix (e.g. pol_).
google/veo2Video generation status or completed video
Bad Request - Invalid taskId or model
Invalid Credentials - Your API key is invalid, missing, or disabled. Check your credentials.
Note: the 401 error body uses code, message, param, and type (there is no status field), and type is invalid_request_error.
Not Found - Invalid taskId or expired result
Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.
Internal Server Error
Last updated
