# Seedance 2.5

Canonical page: https://agentsky.dev/models/bytedance/seedance-2.5
JSON record: https://gateway.agentsky.dev/v1/endpoints/bytedance/seedance-2.5

Seedance 2.5 is a video model from Bytedance, callable through the AgentSky API as bytedance/seedance-2.5 and billed per token (without_video (default): $0.00001024 · with_video: $0.00000612).

Generate a 4–30 second video with optional synchronized audio. 480p and 720p output are supported. Accepts text, image, video and audio content. Audio requires text, image or video. Any video reference selects the with_video output-token tier; other inputs use without_video. See the pricing table for your plan rates. 4K output is unsupported. Billing uses the completed task's output tokens.

After COMPLETED, read run.output.video_url, run.output.duration and run.output.resolution. Download the temporary video URL promptly.

## Facts

- **Id:** `bytedance/seedance-2.5`
- **Provider:** Bytedance
- **Kind:** video model
- **Billed per:** token
- **Timeout:** 25 min
- **Max request:** 1 MB

## Call it

`POST https://gateway.agentsky.dev/v1/run` with `{"provider": "bytedance", "endpoint": "seedance-2.5", "input": {…}}` and `Authorization: Bearer $AGENTSKY_API_KEY`.

### Input fields

| Field | Type | Required | Description |
|---|---|---|---|
| `prompt` | string | no | Describe the scene and movement. Use either prompt or content. |
| `content` | array | no | Nonempty native text/image_url/video_url/audio_url items; media URLs require HTTPS, images also accept inline PNG/JPEG/WebP data. Optional roles: first_frame/reference_image, reference_video, reference_audio. Mutually exclusive with prompt. |
| `input_mode` | string | no | Optional assertion of the automatically derived content tier. Must match the supplied content. Allowed: without_video, with_video. |
| `resolution` | string | no | Output resolution. Allowed: 480p, 720p. Default: "720p". |
| `duration` | integer | no | Requested duration: -1 for automatic, or 4–30 seconds. Output uses actual measured duration. Default: 5. |
| `ratio` | string | no | Output aspect ratio. Allowed: 16:9, 4:3, 1:1, 3:4, 9:16, 21:9, adaptive. Default: "adaptive". |
| `generate_audio` | boolean | no | Generate synchronized audio. Default: true. |
| `output_format` | string | no | Output video container. Allowed: mp4, mov. |
| `watermark` | boolean | no | Add a generation watermark. Default: false. |

## Example

### curl

```bash
# Set once per job; reuse this key and the identical body after a timeout.
: "${AGENTSKY_IDEMPOTENCY_KEY:?Set a unique, saved key for this job}"
curl --fail-with-body https://gateway.agentsky.dev/v1/run \
  -H "authorization: Bearer $AGENTSKY_API_KEY" \
  -H "content-type: application/json" \
  -H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \
  -d '{"provider":"bytedance","endpoint":"seedance-2.5","input":{"prompt":"A blue sphere slowly rotates on a white background.","duration":5,"resolution":"720p"}}'
# If status is READY/RUNNING, poll GET /v1/runs/{runId} with the same API key.
```

### JavaScript

```js
// Node.js 20+. Save one unique key per job; reuse it with the identical body.
const key = process.env.AGENTSKY_IDEMPOTENCY_KEY;
if (!key || !process.env.AGENTSKY_API_KEY) {
  throw new Error("Set AGENTSKY_API_KEY and a saved AGENTSKY_IDEMPOTENCY_KEY first");
}
const base = "https://gateway.agentsky.dev";
const headers = {
  authorization: `Bearer ${process.env.AGENTSKY_API_KEY}`,
  "content-type": "application/json",
  "Idempotency-Key": key,
};
const body = JSON.stringify({
  "provider": "bytedance",
  "endpoint": "seedance-2.5",
  "input": {
    "prompt": "A blue sphere slowly rotates on a white background.",
    "duration": 5,
    "resolution": "720p"
  }
});
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

async function request(path, options = {}) {
  for (let attempt = 0; attempt < 3; attempt++) {
    let response;
    let data;
    try {
      response = await fetch(base + path, {
        ...options, headers, signal: AbortSignal.timeout(180_000),
      });
      const text = await response.text();
      try { data = JSON.parse(text); } catch { /* Proxy timeouts may return HTML. */ }
    } catch (error) {
      if (attempt === 2) throw error; // Resume with the same key and body.
      await sleep(2000);
      continue;
    }
    // Failed runs can have non-2xx HTTP status. Never regenerate them automatically.
    if (data?.runId && data?.status) return data;
    if (response.ok && data) throw new Error("Unexpected response: missing runId/status");
    if (attempt < 2 && (response.status >= 500 || response.status === 408 || response.status === 429)) {
      await sleep(2000);
      continue; // POST retries keep the original key and body.
    }
    throw new Error(`HTTP ${response.status}: ${JSON.stringify(data ?? "Non-JSON response; retry with the same key and body")}`);
  }
}

let run = await request("/v1/run", { method: "POST", body });
console.log("Save runId:", run.runId);
const deadline = Date.now() + 30 * 60_000;
while (["READY", "RUNNING"].includes(run.status)) {
  if (Date.now() >= deadline) {
    throw new Error(`Still pending: poll /v1/runs/${run.runId} later; do not create a new job`);
  }
  await sleep(5000);
  run = await request(`/v1/runs/${encodeURIComponent(run.runId)}`);
}
console.log("Status:", run.status, "Charge:", run.price?.amount);
if (run.status !== "COMPLETED") {
  throw new Error(`Run ${run.runId}: ${JSON.stringify(run.error ?? run.status)}`);
}
console.log(run.output); // Output shape depends on the endpoint.
// READY/RUNNING price is provisional. Use the terminal receipt for reconciliation.
```

## Pricing

| Input conditions | Availability | USD per token |
|---|---|---|
| without_video (default) | Available | $0.00001024 |
| with_video | Available | $0.00000612 |

Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.

## Questions

### What does Seedance 2.5 do?

Generate a 4–30 second video with optional synchronized audio. 480p and 720p output are supported. Accepts text, image, video and audio content. Audio requires text, image or video. Any video reference selects the with_video output-token tier; other inputs use without_video. See the pricing table for your plan rates. 4K output is unsupported. Billing uses the completed task's output tokens.

### How much does Seedance 2.5 cost?

without_video (default): $0.00001024 · with_video: $0.00000612 per token, using your plan when signed in. The customer charge is returned as price.amount.value with its currency; READY/RUNNING values are provisional.

### What does Seedance 2.5 take?

Nothing is required. Send an empty input object in a POST to /v1/run.

### What are the limits on Seedance 2.5?

The catalog lists an execution timeout of 25 min. A request can return READY or RUNNING before completion; poll GET /v1/runs/{runId} with the same API key until it reaches a terminal status. An HTTP timeout does not prove the generation stopped.

### How do I retry safely and check the final charge?

Save a unique Idempotency-Key for each job. After a network error or HTML timeout, resend the identical POST body with the same key and API key to recover the existing run, then poll its runId. A new key can start another billable generation. An HTTP error or timeout does not establish the run outcome or final charge. Pending runs can still settle; check the terminal price.amount and billing state, and retain the runId for reconciliation. Do not automatically create a new job after a terminal failure.
