Image Edit
Edits images using natural language instructions. Supports openai/gpt-image-1 model with PNG, WEBP, or JPG formats (max 50MB per image, up to 16 images). Requires multipart/form-data.
Tip: Supported parameters and their accepted values differ from one model to another. Call GET /api/v1/models and inspect each model's
supported_parametersandsupported_params_detailsto see exactly which fields it accepts and the allowed values, ranges, or enums.
FastRouter API Key. Get yours at https://fastrouter.ai
Format: Authorization: Bearer YOUR_API_KEY
The image(s) to edit. Must be PNG, WEBP, or JPG and smaller than 50MB each. Supports up to 16 images.
Single image file
Array of image files (up to 16)
Text description of the desired modification. Max length: 32,000 characters for gpt-image-1.
Change the color of the cycle to blueMust be 'openai/gpt-image-1'
openai/gpt-image-1Possible values: Number of edited images to generate (1-10)
1Output image size. Options: 1024x1024, 1536x1024, 1024x1536, or auto
1024x1024Possible values: Output image format: png, jpeg, or webp
pngPossible values: Compression level (0-100) for JPEG or WEBP outputs. Higher values mean better quality.
100Optional PNG mask file (< 4MB). Transparent areas indicate regions to edit. Must match dimensions of the first input image.
Controls background transparency: transparent, opaque, or auto. If transparent, output format must be png or webp.
autoPossible values: Format of the response data
urlPossible values: Image edited successfully
Unix timestamp
Bad Request - Invalid parameters or image format
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.
Payload Too Large - Image exceeds 50MB limit
Rate Limited - You have exceeded your request limits (TPM/RPM). Slow down or increase your limits.
Internal Server Error
POST /api/v1/images/edits HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 140
{
"model": "openai/gpt-image-1",
"prompt": "Change the color of the cycle to blue",
"image": "(binary file: yellow-cycle.png)",
"size": "1024x1024"
}{
"created": 1704892800,
"data": [
{
"url": "https://example.com/edited-image.png",
"revised_prompt": "Changed the bicycle color to blue"
}
]
}Last updated
