> For the complete documentation index, see [llms.txt](https://bountyv.gitbook.io/vdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bountyv.gitbook.io/vdocs/frontier-passthrough/frontier-seedream.md).

# Seedream 4.x

BytePlus ModelArk Seedream 4.x on ModelArk's own parameters. Synchronous, fast (\~6–20s), up to 4K.

```
POST /api/v1/frontier/seedream
```

The headline difference from `engine=seedream` on [Text-to-Image](/vdocs/image-api/images-txt2img.md) is **sequential-set mode**: one call can return a coherent set of N images — the same character across four seasons, a product in six settings — which the wrapped engine pins to a single image.

## Authentication

```
Authorization: Bearer sk_live_...
```

## Request

**Content-Type:** `application/json`

| Field       | Type      | Required | Default | Description                                                                                                                          |
| ----------- | --------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `prompt`    | string    | ✅        | —       | What to generate                                                                                                                     |
| `images`    | string\[] | —        | —       | Up to 10 references, in prompt order ("image 1", …). `data:` URL, public https URL, or bare base64. Omit for text-to-image           |
| `image`     | string    | —        | —       | Single reference, same formats                                                                                                       |
| `size`      | string    | —        | `"2K"`  | `"2K"` \| `"4K"`. Seedream 4.5 does **not** accept `"1K"` — passing it returns `400` with the supported list. (Seedream 5 Pro does.) |
| `count`     | integer   | —        | `1`     | Sequential-set mode: how many images to generate as one coherent set. Also accepted as `max_images`                                  |
| `watermark` | boolean   | —        | `false` | Provider watermark                                                                                                                   |

### The 15-image budget

ModelArk caps **references + generated images at 15**. With `R` references your ceiling is `15 − R`, so 10 references leaves room for 5 outputs. Asking for more returns `400` with a `max_count` field rather than silently generating fewer than you paid for.

## Response

```json
{
  "image": "https://.../generations/<id>.jpg?token=...",
  "generation_id": "gJ8nP3kQ2m",
  "images": [
    { "image": "https://...", "generation_id": "gJ8nP3kQ2m" },
    { "image": "https://...", "generation_id": "hK9mQ4rL3n" }
  ],
  "model": "Seedream 4.x",
  "reference_images": 1,
  "max_reference_images": 10,
  "count": 2,
  "size": "2K",
  "charged_cents": 58,
  "balance_cents": 4742,
  "elapsed_ms": 14203
}
```

| Field                     | Type           | Description                                                                  |
| ------------------------- | -------------- | ---------------------------------------------------------------------------- |
| `images`                  | array          | One entry per output image, each with its own signed URL and `generation_id` |
| `image` / `generation_id` | string \| null | Mirror the first entry, so single-image callers can ignore the array         |
| `count`                   | integer        | How many images were actually produced                                       |
| `charged_cents`           | integer        | Unit price × images produced                                                 |

Outputs are JPEG.

## Example

A four-image seasonal set from one character reference:

```bash
curl -X POST https://substance-api.com/api/v1/frontier/seedream \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "The woman from image 1 in the same park across four seasons",
    "images": ["https://example.com/character.png"],
    "count": 4,
    "size": "2K"
  }'
```

## Errors

| Status | Meaning                                                                                                                                                  |
| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | Missing `prompt`, a non-positive `count`, `count` over the 15-image budget (`max_count` included), an unreadable image value, or more than 10 references |
| `402`  | Balance below **`count` ×** the unit price — `required_cents` included                                                                                   |
| `403`  | Your account doesn't have the `image` product enabled                                                                                                    |
| `502`  | ModelArk failed. The full charge is refunded — `refunded_cents` and a provider `detail` are included                                                     |
| `503`  | The pipeline is disabled                                                                                                                                 |

## Pricing

$0.29 **per output image** — a `count` of 4 costs $1.16. If the provider returns fewer images than requested, the difference is refunded automatically. Bills on `images.txt2img.seedream`. See [Credits & pricing](/vdocs/account/credits.md).

SFW only — see [Frontier Passthrough → Content policy](/vdocs/frontier-passthrough/frontier-overview.md#content-policy).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bountyv.gitbook.io/vdocs/frontier-passthrough/frontier-seedream.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
