Edit images
Image Editing API
Edit existing images using AI models with text prompts and optional masks. Supports single or multiple input images for models that accept multi-image context.
Supported Models
- gemini-25-flash-image-preview: Google Gemini model for image editing
- fal-ai/bytedance/seedream/v4/edit: Seedream v4 edit on fal.ai (supports URL and base64 images)
Request Parameters
- model: The model to use for editing
- image / images: Base64-encoded source image, or an array of images. For multipart, pass one or more image files or use an images array field.
- prompt: Text description of the edits to make
- mask: Optional base64-encoded mask image (areas to edit)
- n: Number of edited variations to generate (1-8)
- size: Target dimensions for output
- quality: Model-specific tier (e.g., "low/medium/high" for GPT-Image 1, "standard/hd" for Imagen)
- response_format: "url" or "b64_json"
Pricing
Same as image generation - charged per output image
Enter your JWT token in the format: Bearer
In: header
Image edit request with either JSON or multipart/form-data
Image model identifier to use for edits.
Edit instruction describing desired changes.
length <= 4000
Number of edited outputs to produce (1-8).
"1"
1 <= length <= 8
Target resolution for edited outputs.
"1024x1024"
"256x256" | "512x512" | "1024x1024" | "2048x2048" | "1024x768" | "768x1024" | "1920x1080" | "1080x1920"
Quality level for edited images. Supports low/medium/high for OpenAI GPT-Image 1 and standard/HD for Imagen.
"standard"
"standard" | "hd" | "low" | "medium" | "high"
Whether to return URLs or base64 JSON payloads.
"url"
"url" | "b64_json"
Optional end-user identifier forwarded for moderation.
Image file(s) or base64 string(s)
Alternative field for multiple images
Mask file or base64 string (optional)
Response Body
curl -X POST "https://api-beta.daydreams.systems/v1/images/edits" \
-F model="string" \
-F prompt="string"
{
"created": 0,
"data": [
{
"url": "http://example.com",
"b64_json": "string",
"revised_prompt": "string"
}
]
}
{
"error": "Invalid model specified",
"code": "INVALID_MODEL",
"message": "The specified model is not available"
}
{
"error": "Invalid API key",
"code": "INVALID_API_KEY",
"message": "The provided API key is not valid"
}
{
"error": "Insufficient balance",
"code": "INSUFFICIENT_BALANCE",
"message": "Account balance is too low for this operation",
"current_balance": 1.25,
"required_amount": 5
}
{
"error": "Rate limit exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests. Please try again later.",
"retry_after": 60
}
{
"error": "Internal server error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred while processing your request"
}