V1ImagesEdits

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

POST
/v1/images/edits
AuthorizationBearer <token>

Enter your JWT token in the format: Bearer

In: header

Image edit request with either JSON or multipart/form-data

modelstring

Image model identifier to use for edits.

promptstring

Edit instruction describing desired changes.

Lengthlength <= 4000
n?string

Number of edited outputs to produce (1-8).

Default"1"
Length1 <= length <= 8
size?string

Target resolution for edited outputs.

Default"1024x1024"
Value in"256x256" | "512x512" | "1024x1024" | "2048x2048" | "1024x768" | "768x1024" | "1920x1080" | "1080x1920"
quality?string

Quality level for edited images. Supports low/medium/high for OpenAI GPT-Image 1 and standard/HD for Imagen.

Default"standard"
Value in"standard" | "hd" | "low" | "medium" | "high"
response_format?string

Whether to return URLs or base64 JSON payloads.

Default"url"
Value in"url" | "b64_json"
user?string

Optional end-user identifier forwarded for moderation.

image?array<unknown>

Image file(s) or base64 string(s)

images?array<unknown>

Alternative field for multiple images

mask?unknown

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"
}