Images
GetRouter exposes separate endpoints for image generation and image editing.
Choose an image model from Models and review its price and supported options before sending a request.
Generate an image
The response contains a data array. Depending on the request and model, each item can contain a hosted URL or Base64-encoded image data.
Python
Edit an image
Image edits use multipart form data:
A compatible model may also accept a mask and additional model-specific fields.
Common fields
The API also supports provider-specific image payloads for some models. When a model requires a different body shape, use the schema and example shown in the API Reference.
Warning
Image count, dimensions, quality, and edit support vary by model and directly affect cost. Check Pricing before generating batches.
Handle output safely
- Download hosted URLs before they expire.
- Decode
b64_jsonbefore writing it to a file. - Validate the output MIME type in applications that serve generated files.
- Avoid retrying a successful generation just because the client failed to save the response.
