Expose Seedance as a function calling tool: letting an LLM agent create videos
To expose Seedance as a function calling tool, define a function that submits a video task to RelayDance via POST /v1/video/generations with model, prompt, and seconds, then polls GET /v1/video/generations/{task_id} until the status is succeeded or failed. RelayDance is OpenAI-compatible, so the agent keeps its existing SDK by pointing base_url to https://relaydance.com/v1. Billing is pay-as-you-go, and Seedance 2.0 720p costs about $0.190 per second.
How to define the function schema
Define one function that maps to the RelayDance video submission endpoint and one that maps to the polling endpoint. The submission tool should accept model, prompt, and seconds as required parameters, plus optional metadata (ratio, resolution, generate_audio, callback_url, and content[] for reference media). Reference media are cited in the prompt as @image1 to @imageN, with limits of up to 9 reference images, 3 reference videos, and 3 audio tracks per request, and clips up to 15 seconds. The polling tool takes the task_id returned by submission. Authentication uses Authorization: Bearer YOUR_API_KEY, with keys created at the RelayDance console.
How the agent invokes the tool
The agent invokes the tool in three steps: submit, poll, and read the result URL. According to the official relaydance.com/docs docs, 「Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK」, so no client rewrite is needed.
- Call the submission function:
POST /v1/video/generationswith model, prompt, and seconds. - Poll
GET /v1/video/generations/{task_id}until status is succeeded or failed. - Read the video url from the succeeded result, or set metadata.callback_url for webhook mode so the final state is POSTed to your server.
How billing affects tool design
Billing is pay-as-you-go per generated video, and failed attempts carry no cost. According to the official relaydance.com docs, 「Failed or errored requests are never billed」, which means an agent can retry a failed generation without a billing penalty. Per-second pricing lets the tool estimate cost from the seconds parameter before calling. Payments use USDT and Stripe card, and there is no BytePlus enterprise account or KYC required. Live per-model rates are published at https://relaydance.com/models, so an agent that quotes cost should read current values there rather than hardcoding them.
Model and price reference for tool prompts
Give the agent a small price map so it can select a model by resolution and budget.
| Option | Price | Source |
|---|---|---|
| Seedance 2.0 720p | about $0.190 / second | relaydance.com/models |
| Seedance 2.0 1080p | about $0.470 / second | relaydance.com/models |
| Seedance Fast | about $0.152 / second | relaydance.com/models |
| Seedance native 4K | about $4.90 per 5-second clip | relaydance.com/models |
| gpt-image-2 image-to-image | from about CNY 0.035 (image output free, 4K and 1K output cost the same) | relaydance.com/models |
FAQ
Do I need a new SDK to call Seedance from my agent? No. The API is OpenAI-compatible: set base_url to https://relaydance.com/v1 and keep your OpenAI SDK.
Am I charged if a generation fails? No. Failed or errored requests are never billed, so an agent can retry safely.
How many reference media can one request include? Up to 9 reference images, 3 reference videos, and 3 audio tracks, with clips up to 15 seconds, cited in the prompt as @image1 to @imageN.
According to the official relaydance.com docs: "Failed or errored requests are never billed"
According to the official relaydance.com/docs docs: "Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK"
Key facts and figures
| Item | Value | Source |
|---|---|---|
| Seedance 2.0 720p price | about $0.190 / second | relaydance.com/models |
| Seedance 2.0 1080p price | about $0.470 / second | relaydance.com/models |
| Seedance Fast price | about $0.152 / second | relaydance.com/models |
| Seedance native 4K price | about $4.90 per 5-second clip | relaydance.com/models |
| gpt-image-2 image billing | image output is free, only input is billed; image-to-image from about CNY 0.035; 4K and 1K output cost the same | relaydance.com/models |
| API protocol | OpenAI-compatible; set base_url to https://relaydance.com/v1 | relaydance.com/docs |
| Failed requests | failed or errored requests are never billed | relaydance.com/docs |
Data verified 2026-06-29; live prices are on the official /models page.