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.
| Model | Text-to-image ID | Edit ID | Resolutions | Edit input images |
|---|---|---|---|---|
| Seedream 5.0 Pro | bytedance/seedream-v5.0-pro | bytedance/seedream-v5.0-pro/edit | 1k, 2k | 1 to 8 |
| Seedream 4.5 | bytedance/seedream-v4.5 | bytedance/seedream-v4.5/edit | 1k, 2k, 4k | 1 to 8 |
| Nano Banana Pro | google/nano-banana-pro/text-to-image | google/nano-banana-pro/edit | 1k, 2k, 4k | 1 to 8 |
| Nano Banana 2 | google/nano-banana-2/text-to-image | google/nano-banana-2/edit | 0.5k, 1k, 2k, 4k | 1 to 8 |
| GPT Image 2 | openai/gpt-image-2/text-to-image | openai/gpt-image-2/edit | 1k, 2k, 4k | 1 |
Every image model accepts the aspect ratios 16:9, 9:16, 4:3, 3:4, 1:1, and 21:9.
Parameters
| Field | Type | Description |
|---|---|---|
model | string | Required. A text-to-image or edit ID from the table. |
prompt | string | Required. What to create, or the edit to apply to the input images. |
image_urls | string[] | 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_ratio | string | Default 16:9. 16:9, 9:16, 4:3, 3:4, 1:1, or 21:9. |
resolution | string | One of the model's resolutions. Higher resolutions can cost more. |
num_outputs | integer | Default 1. Number of images for text-to-image models. Each returned image is billed. |
parameters.output_format | string | png, 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.