EggAPI/docs / models/image
sign in

Image Models

Text-to-image and image editing with Seedream, Nano Banana, and GPT Image 2

Image models create image_generate tasks (text-to-image) or image_edit tasks (image-to-image). Both run asynchronously through POST /v1/generate and are billed per output image at the price of the requested resolution.

ModelText-to-image IDEdit IDResolutionsEdit input images
Seedream 5.0 Probytedance/seedream-v5.0-probytedance/seedream-v5.0-pro/edit1k, 2k1 to 8
Seedream 4.5bytedance/seedream-v4.5bytedance/seedream-v4.5/edit1k, 2k, 4k1 to 8
Nano Banana Progoogle/nano-banana-pro/text-to-imagegoogle/nano-banana-pro/edit1k, 2k, 4k1 to 8
Nano Banana 2google/nano-banana-2/text-to-imagegoogle/nano-banana-2/edit0.5k, 1k, 2k, 4k1 to 8
GPT Image 2openai/gpt-image-2/text-to-imageopenai/gpt-image-2/edit1k, 2k, 4k1

Every image model accepts the aspect ratios 16:9, 9:16, 4:3, 3:4, 1:1, and 21:9.

Parameters

FieldTypeDescription
modelstringRequired. A text-to-image or edit ID from the table.
promptstringRequired. What to create, or the edit to apply to the input images.
image_urlsstring[]Required for edit models: public http(s) URLs of the source images, within the model's input limit. Not used by text-to-image models.
aspect_ratiostringDefault 16:9. 16:9, 9:16, 4:3, 3:4, 1:1, or 21:9.
resolutionstringOne of the model's resolutions. Higher resolutions can cost more.
num_outputsintegerDefault 1. Number of images for text-to-image models. Each returned image is billed.
parameters.output_formatstringpng, jpeg, or webp, where the model supports it.

Generate an Image

bash
curl -X POST https://api.eggapi.ai/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bytedance/seedream-v4.5",
    "prompt": "A clean editorial photo of a lemon tart on a steel table",
    "aspect_ratio": "4:3",
    "resolution": "2k",
    "num_outputs": 1,
    "parameters": { "output_format": "png" }
  }'
python
import requests

response = requests.post(
    "https://api.eggapi.ai/v1/generate",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "bytedance/seedream-v4.5",
        "prompt": "A clean editorial photo of a lemon tart on a steel table",
        "aspect_ratio": "4:3",
        "resolution": "2k",
        "num_outputs": 1,
        "parameters": {"output_format": "png"},
    },
)

task = response.json()["data"]
print(task["id"])
javascript
const response = await fetch("https://api.eggapi.ai/v1/generate", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    model: "bytedance/seedream-v4.5",
    prompt: "A clean editorial photo of a lemon tart on a steel table",
    aspect_ratio: "4:3",
    resolution: "2k",
    num_outputs: 1,
    parameters: { output_format: "png" }
  })
});

const { data: task } = await response.json();
console.log(task.id);

Response:

json
{
  "data": {
    "id": "gen_3f2a9c1d-7b4",
    "status": "pending",
    "model": "bytedance/seedream-v4.5",
    "type": "image_generate",
    "cost": "$0.00",
    "created_at": "2026-10-26T10:30:00Z"
  },
  "error": null
}

Edit an Image

Use an edit model and pass the source images in image_urls. To edit a local file, upload it first with POST /v1/uploads.

bash
curl -X POST https://api.eggapi.ai/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-pro/edit",
    "prompt": "Replace the background with a quiet marble kitchen",
    "image_urls": ["https://file.eggapi.ai/uploads/image/your-user-id/input.png"],
    "resolution": "2k"
  }'

The task type is image_edit. A request to an edit model without input images is rejected with 400 VALIDATION_ERROR.

Completed Output

json
{
  "data": {
    "id": "gen_3f2a9c1d-7b4",
    "status": "completed",
    "model": "bytedance/seedream-v4.5",
    "type": "image_generate",
    "output": {
      "url": "https://file.eggapi.ai/images/gen_3f2a9c1d-7b4/0.png",
      "urls": ["https://file.eggapi.ai/images/gen_3f2a9c1d-7b4/0.png"]
    },
    "cost": "$0.0500",
    "created_at": "2026-10-26T10:30:00Z",
    "started_at": "2026-10-26T10:30:01Z",
    "completed_at": "2026-10-26T10:30:10Z"
  },
  "error": null
}

output.urls lists every image; output.url is the first one.

connected
mcp https://api.eggapi.ai/mcp
models ...
Claude Code · Codex · MCP
█