Source: https://www.tokenify.dev/docs/images/seedream-api/

# The Seedream API format

Code written against the Seedream API works here by changing the base URL and the key: the same fields, the same response, the same error codes.

## [What you change](https://www.tokenify.dev/docs/images/seedream-api/#change)

The base URL and the key. **The base URL is https://api.tokenify.dev/api/v3** — the same shape as that API’s own, so the SDK’s default path works unchanged. A base URL at the domain root works too: the client then posts to `/images/generations`, which reads either this format or the OpenAI one from the body it was given.

```bash
curl https://api.tokenify.dev/api/v3/images/generations \
  -H "Authorization: Bearer $TOKENIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bytedance/seedream-5.0-pro",
    "prompt": "A still life of three pears, soft window light",
    "size": "2K"
  }'
```

`model` takes our ids, and it also takes the model ids that format uses — so a request that names a model the way your existing code does keeps working. The reply echoes whichever you sent, which is what a client comparing the two expects.

Which ids those are: the ones that API’s own documentation gives for the Seedream 5.0 image models, in the spelling it gives them — including the dated ones. They are not listed here, because the list that matters is the one in that API’s documentation and a copy of it here would be wrong the week they publish a new build. If an id works there for one of the three models below, it works here.

Those ids work on this endpoint and nowhere else. On `/v1/images/generations`, on `/v1/chat/completions` and in `/v1/models` the only names are ours.

## [The fields](https://www.tokenify.dev/docs/images/seedream-api/#fields)

| Field                         | Here                                                                                                                                                                                                                                                                                             |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| prompt                        | Required, unless you send an image to work from.                                                                                                                                                                                                                                                 |
| image                         | One string or an array. An https URL or a data URI. The per-model ceiling is in /v1/models as max\_input\_images.                                                                                                                                                                                |
| size                          | A tier or WIDTHxHEIGHT, per model. The tiers and the range are on the image generation page.                                                                                                                                                                                                     |
| response\_format              | url (the default here, as in that format) or b64\_json. Our links last 7 days.                                                                                                                                                                                                                   |
| output\_format                | png or jpeg.                                                                                                                                                                                                                                                                                     |
| background                    | transparent or opaque, on the models that have it. Transparent needs png.                                                                                                                                                                                                                        |
| watermark                     | false by default here, which is the one default we changed. Send true to have the mark.                                                                                                                                                                                                          |
| sequential\_image\_generation | With sequential\_image\_generation\_options.max\_images, asks for several images. The ceiling is per model. disabled together with a max\_images above one is a 400: the two halves of that request disagree about how many images you are paying for, so neither reading of it is ours to pick. |
| layer\_decomposition          | Splits one image into a base and its layers. See [layer decomposition](https://www.tokenify.dev/docs/images/layers/).                                                                                                                                                                            |

**Accepted and ignored**: `optimize_prompt_options`, `seed`, `guidance_scale`, `encrypted_content`. **Any field sent as** `null` counts as absent, whatever its name — which is what that SDK sends for every option you did not set. **Refused with a 400 naming the field**: `stream` (not yet), a field whose type we cannot read, and anything unrecognised with a value.

## [The reply](https://www.tokenify.dev/docs/images/seedream-api/#reply)

```jsonc
{
  "model": "bytedance/seedream-5.0-pro",
  "created": 1760000000,
  "data": [{ "url": "https://img.tokenify.dev/…", "size": "2048x2048", "output_format": "jpeg" }],
  // Ours, not part of that format: Unix seconds, 7 days out.
  "expires_at": 1760604800,
  "usage": {
    "generated_images": 1,
    "input_images": 0,
    // Their metering rule — the sum of width x height over the images in this
    // reply, divided by 256. Not what you are charged on: the charge is per image.
    "output_tokens": 16384,
    "total_tokens": 16384
  }
}
```

## [Where we differ](https://www.tokenify.dev/docs/images/seedream-api/#differences)

|                | There                       | Here                                                                                                                      |
| -------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Link lifetime  | 24 hours                    | 7 days, and the reply says when in expires\_at                                                                            |
| Watermark      | On by default               | Off by default; send watermark: true for it                                                                               |
| Streaming      | Supported on some models    | A 400\. The reply is one JSON document                                                                                    |
| Unknown fields | Ignored                     | A 400 naming the field, so a parameter you expected to work cannot silently do nothing                                    |
| Models         | Several generations of them | The three on [our models page](https://www.tokenify.dev/models/). A model id we do not serve is a 404 listing what we do. |

## [Errors](https://www.tokenify.dev/docs/images/seedream-api/#errors)

The envelope and the codes are that format’s, so a client switching on `error.code` keeps working:

```jsonc
{ "error": { "code": "InvalidParameter", "message": "…" } }
```

| Code                             | When                                                                                                                                     |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| AuthenticationError              | No key, or a key we do not recognise — 401. This used to come back as InvalidParameter, which is the wrong thing for an SDK to retry on. |
| InvalidParameter                 | A field is wrong: the size, an image, an unknown parameter.                                                                              |
| MissingParameter                 | No prompt and no image, or no model.                                                                                                     |
| InvalidEndpointOrModel.NotFound  | A model we do not serve.                                                                                                                 |
| AccessDenied                     | This key is not permitted to use that model.                                                                                             |
| AccountOverdueError              | Your balance will not cover the request.                                                                                                 |
| SensitiveContentDetected         | The content policy refused the request.                                                                                                  |
| ModelAccountIpmRateLimitExceeded | Above your images a minute. Retry-After says when.                                                                                       |
| InternalServiceError             | Our side or the model’s. Nothing is charged.                                                                                             |

**The message is ours.** Every error on this route is written here rather than passed along, in their code vocabulary so your error handling keeps working — and the wording is ours because an error that describes the inside of the request path is an error nobody outside it can act on.

Last updated 2026-10-13.
