Expose Seedance as a function calling tool: letting an LLM agent create videos
To expose Seedance as a function calling tool, define a tool such as create_video whose parameters (model, prompt, seconds, ratio, resolution) map to POST /v1/video/generations on RelayDance. Your code executes the call and polls GET /v1/videos/{task_id} until the status is completed. The LLM agent decides when to call the tool, and your handler submits the task and returns metadata.url to the agent.
How do you define the Seedance tool schema for an LLM agent?
You define a JSON schema tool whose arguments match the RelayDance video request fields. A create_video tool can expose prompt (string), seconds (integer), resolution (enum), and ratio (string). The handler places resolution and ratio inside metadata. For Seedance 2.5, constrain seconds to a minimum of 4 and a maximum of 30, because clips run from 4 to 30 seconds. Limit resolution to 480p, 720p or 1080p. Keep the model ID in your handler rather than in the schema, so the agent cannot select a more expensive model on its own. Take the exact model ID from relaydance.com/models. If you want sound, add a boolean generate_audio argument that maps to metadata.generate_audio. Tight enums and ranges reduce invalid calls and make the agent's arguments easier to validate before you spend money.
How does the tool handler call the RelayDance API?
The handler sends the agent's arguments to an OpenAI-compatible endpoint, waits for the result, and returns the clip URL. According to the relaydance.com docs, “Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK”. The handler follows this sequence:
- Authenticate with
Authorization: Bearer YOUR_API_KEY, using a key created athttps://relaydance.com/console. - Submit
POST /v1/video/generationswithmodel,prompt,seconds, andmetadata(ratio, resolution, generate_audio). - Store the returned
task_id. - Poll
GET /v1/videos/{task_id}until the status iscompletedorfailed. As an alternative, setmetadata.callback_urlso that RelayDance POSTs the final state to your server. - Return
metadata.url(or the failure) to the agent as the tool result.
Full request details are in the RelayDance docs.
How much does an agent-triggered Seedance video cost?
Cost is billed pay-as-you-go per generated second, so the seconds and resolution arguments set the price. Seedance 2.5 costs about $0.130 per second at 480p, $0.289 per second at 720p, and $0.711 per second at 1080p. At those rates, a 10-second 720p clip costs about $2.89. Seedance 2.0 costs about $0.190 per second at 720p and $0.470 per second at 1080p. Its Fast tier costs about $0.152 per second, and native 4K costs about $4.90 per 5-second clip. Agent retries after errors do not add cost: “Failed or errored requests are never billed”, according to relaydance.com. To keep spending predictable, cap seconds in the schema and default the agent to 480p for drafts. Live per-model rates are listed at relaydance.com/models.
Can the agent pass reference media or edit existing clips?
Yes, the agent can pass reference media through metadata.content[] and can ask Seedance to edit or extend a clip. Each reference image is cited in the prompt as @image1 to @imageN, so the tool's prompt description should explain this syntax to the agent.
The per-request limits differ by model:
- Seedance 2.5 accepts up to 30 reference images, 10 reference videos and 10 audio clips.
- Seedance 2.0 accepts up to 9 images, 3 videos and 3 audio tracks.
Upload local files with POST /v1/files before you reference them. Seedance 2.5 and the Seedance 2.0 family can edit or extend an existing clip from the prompt, without masks. On Seedance 2.5, editing and extension require ratio adaptive, and editing requests omit seconds. Your handler should enforce these rules when the agent selects an edit action.
FAQ
The answers below cover common integration questions about agent tools on RelayDance.
Do I need a BytePlus enterprise account to use Seedance this way? No. RelayDance does not require a BytePlus enterprise account or KYC. You authenticate with a RelayDance API key and can pay with USDT or a Stripe card.
Can the same agent also generate images? Yes. You can add a second tool that calls POST /v1/images/generations. For example, Seedream 4.5 costs $0.05 per image, and gpt-image-2.6 costs a flat $0.04 per image.
Can I offer the agent other video models? Yes. You can expose Kling 4.0 (3 to 30 seconds, native audio), MiniMax H3 (4 to 15 seconds) or Wan 3.0 (2 to 15 seconds) through the same endpoint by changing the model ID.
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.5 price | 480p about $0.130 / second, 720p about $0.289 / second, 1080p about $0.711 / second; clips of 4 to 30 seconds | relaydance.com/seedance-2-5-api |
| Seedance 2.0 price | 720p about $0.190 / second, 1080p about $0.470 / second, Fast about $0.152 / second, native 4K about $4.90 per 5-second clip | relaydance.com/seedance-2-0-api |
| Kling 4.0 price | kling-v4 (720p) $0.19625 / second, kling-v4-pro (1080p) $0.29375 / second; 3 to 30 seconds, native audio included in the price; 1.2x with a reference video | relaydance.com/docs/model-capabilities |
| MiniMax H3 price | minimax-h3-768p $0.10 / second, minimax-h3-2k $0.1625 / second; 4 to 15 seconds, native stereo audio | relaydance.com console pricing |
| Wan 3.0 price | 480p $0.0625 / second, 720p $0.125 / second, 1080p $0.25 / second; 2 to 15 seconds, text-to-video or one first-frame image, native stereo audio | relaydance.com/docs/model-capabilities |
| Seedream 4.5 images | $0.05 per image produced, 2K or 4K, reference pictures free, up to 15 related images per call, no watermark by default | relaydance.com/docs/image |
| gpt-image-2.6 images | flat $0.04 per image returned; PNG, JPEG, WebP, animated GIF or SVG; transparent backgrounds; image editing on /v1/images/edits | relaydance.com/docs/image |
| 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 |
| Video editing and extension | Seedance 2.5 and the Seedance 2.0 family edit or extend an existing clip from the prompt, no masks; on Seedance 2.5 editing and extension require ratio adaptive, and editing omits seconds | relaydance.com/docs/model-capabilities |
| Reference media limits | Seedance 2.5: up to 30 reference images, 10 reference videos and 10 audio clips per request; Seedance 2.0: up to 9 images, 3 videos and 3 audio tracks | relaydance.com/docs/model-capabilities |
| 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-11-27; live prices are on the official /models page.