Seedream 5.0 API Reference
Generate and edit images with Seedream 5.0 Pro and Seedream 4.5 through a simple asynchronous REST API: submit a task, get a task_id back, then poll for the result.
Quickstart
Create a task, then poll until it finishes. When you are signed in, your own API key is filled into the snippet.
- Get an API keyCreate one in your dashboard and keep it on your server.
- Send your first requestRun the snippet with your key in the Authorization header.
- Read the resultCheck the JSON response. Long jobs return a task ID you can poll.
# 1. Create a taskcurl -X POST https://seedream45ai.org/api/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedream-5-pro","prompt":"Cinematic photo of an obsidian smartwatch on a marble plinth, volumetric lighting","aspectRatio":"4:3","quality":"high"}'# 2. Poll the result with the returned task_idcurl "https://seedream45ai.org/api/status?task_id=YOUR_TASK_ID" \ -H "Authorization: Bearer YOUR_API_KEY"Authentication
Send your API key as a Bearer token in the Authorization header of every request.
Models
Choose a model with the model field. Without it, requests run on Seedream 4.5 text-to-image.
| Model | Mode | Notes |
|---|---|---|
| seedream-5-pro | Text-to-image, image-to-image | Recommended. Switches to image-to-image automatically when imageUrls is set (up to 10 references). basic = 1K, high = 2K. 21:9 is not supported. |
| seedream/4.5-text-to-image | Text-to-image | Default model. basic = 2K, high = 4K. imageUrls is ignored. |
| seedream/4.5-edit | Image-to-image | Needs at least one image in imageUrls. basic = 2K, high = 4K. |
Credit pricing
Credits are deducted when the task is accepted.
| Request | Credits |
|---|---|
| seedream-5-pro · basic (1K) | 9 |
| seedream-5-pro · high (2K) | 18 |
| seedream-5-pro · each reference image after the first | +0.8 |
| seedream/4.5-text-to-image · basic or high | 12 |
| seedream/4.5-edit · basic or high | 12 |
Endpoints
Submits a Seedream task and returns a task_id right away. The image renders asynchronously.
promptstringRequiredText description of the image, up to 3000 characters.
modelstringOptionalModel to run. See the Models table above. Defaults to
seedream/4.5-text-to-image.aspectRatiostringOptionalOutput aspect ratio. aspect_ratio is accepted as an alias. seedream-5-pro does not support
21:9. Defaults to1:1.qualitystringOptionalbasicorhigh. Sets the output resolution and, for seedream-5-pro, the price. Defaults tobasic.imageUrlsstring[]OptionalPublic URLs of reference images. Required for seedream/4.5-edit; turns seedream-5-pro into image-to-image (up to 10).
Example: text-to-image
Example: image-to-image with a reference
Responses
Returns the latest task record. While a task is PENDING or IN_PROGRESS, the server also checks the upstream provider before replying.
task_idstringRequiredThe task_id returned by /api/generate.
Example request
task_idstringOptionalTask ID.
statusstringOptionalCurrent task state.
requestobjectOptionalSnapshot of the parameters you submitted.
responsestring[]OptionalImage URLs once the task is SUCCESS.
consumed_creditsnumberOptionalCredits charged for the task; 0 after a refund.
error_messagestring | nullOptionalReason for the failure when status is FAILED.
created_atstringOptionalUTC time the task was created.
Responses
Try it
Send real requests from this page. Replace YOUR_API_KEY with your key; generate requests consume credits.
API Playground
POST/api/generate
- Prepared
- Sent
- Response
Recent calls
Calls you send in this session show up here.
Errors
Errors return a JSON body with code and message. Retry 429 and 5xx responses with exponential backoff.
| HTTP | Meaning |
|---|---|
| 400Bad Request | Missing prompt, unsupported aspect ratio or quality, or no reference image for an edit model. |
| 401Unauthorized | Missing or invalid API key. |
| 402Payment Required | Not enough credits for this task. |
| 404Not Found | No task matches this task_id. |
| 429Too Many Requests | Too many requests. Slow down your request or polling rate. |
| 500Internal Server Error | Temporary server or provider error. Retry with backoff. |
FAQ
Which model should I use?
Use seedream-5-pro for the best quality and for edits with several references. Seedream 4.5 costs a flat 12 credits per task and can output 4K with high quality.
How often should I poll /api/status?
Every 3 to 5 seconds is enough. Stop polling once status is SUCCESS or FAILED.
Are credits refunded when a task fails?
Yes. If generation fails, the credits for that task go back to your balance automatically and consumed_credits becomes 0.
Where can I see the tasks I created through the API?
Open Dashboard → Logs and pick your API key to browse every task with its status, credits and output images.