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.

  1. Call the submission function: POST /v1/video/generations with model, prompt, and seconds.
  2. Poll GET /v1/video/generations/{task_id} until status is succeeded or failed.
  3. 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.

OptionPriceSource
Seedance 2.0 720pabout $0.190 / secondrelaydance.com/models
Seedance 2.0 1080pabout $0.470 / secondrelaydance.com/models
Seedance Fastabout $0.152 / secondrelaydance.com/models
Seedance native 4Kabout $4.90 per 5-second cliprelaydance.com/models
gpt-image-2 image-to-imagefrom 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

ItemValueSource
Seedance 2.0 720p priceabout $0.190 / secondrelaydance.com/models
Seedance 2.0 1080p priceabout $0.470 / secondrelaydance.com/models
Seedance Fast priceabout $0.152 / secondrelaydance.com/models
Seedance native 4K priceabout $4.90 per 5-second cliprelaydance.com/models
gpt-image-2 image billingimage output is free, only input is billed; image-to-image from about CNY 0.035; 4K and 1K output cost the samerelaydance.com/models
API protocolOpenAI-compatible; set base_url to https://relaydance.com/v1relaydance.com/docs
Failed requestsfailed or errored requests are never billedrelaydance.com/docs

Data verified 2026-06-29; live prices are on the official /models page.


RelayDance home · Models and pricing · Docs · All guides · Privacy Policy · User Agreement · Telegram community · RelayRouter (LLM API) · Live playground