Telegram bot video generation: async task handling with the RelayDance API

To generate video inside a Telegram bot with RelayDance, submit an asynchronous task via POST /v1/video/generations, then either poll GET /v1/video/generations/{task_id} until the status is succeeded or failed, or set metadata.callback_url so the final state is posted to your server. The API is OpenAI-compatible: set base_url to https://relaydance.com/v1. Seedance 2.0 720p costs about $0.190 per second, and failed requests are never billed.

How to submit and track an async video task

Use two endpoints: one to create the task and one to read its state. Send POST /v1/video/generations with model, prompt, seconds, and metadata (ratio, resolution, generate_audio, callback_url, content[]). The response returns a task_id. For a Telegram bot, the polling loop keeps the chat responsive while generation runs.

  1. Send POST /v1/video/generations with your model and prompt.
  2. Store the returned task_id against the Telegram chat_id.
  3. Poll GET /v1/video/generations/{task_id} until status is succeeded or failed.
  4. On succeeded, read the video url from the result and send it to the chat.

See the flow in the official docs at relaydance.com/docs.

Webhook mode versus polling for a bot

Choose webhook mode when you want RelayDance to push the final state to your server instead of polling. Set metadata.callback_url and the final state is POSTed to your endpoint, which then forwards the video url to Telegram. Polling suits simple bots; webhooks reduce request volume for higher throughput.

ModeTriggerBest for
PollingGET /v1/video/generations/{task_id}Single bots, low volume
Webhookmetadata.callback_url receives POSTHigher throughput

Reference media go in metadata.content[] and are cited in the prompt as @image1 to @imageN, with up to 9 reference images, 3 reference videos, and 3 audio tracks per request, and clips up to 15 seconds.

Authentication and OpenAI-compatible setup

Authenticate with a Bearer token and reuse your existing OpenAI SDK. Create keys at the console (https://relaydance.com/console) and send Authorization: Bearer YOUR_API_KEY. Because the API is OpenAI-compatible, migration is minimal. 「Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK」, 据 relaydance.com/docs 官方文档. This lets a Telegram bot written against the OpenAI client point at RelayDance without rewriting request logic, so your handlers for task creation and status reads stay the same shape.

Pricing and billing for bot workloads

Billing is pay-as-you-go per generated video, and failed or errored requests are never billed. Seedance 2.0 720p costs about $0.190 per second and 1080p about $0.470 per second, Seedance Fast is about $0.152 per second, and Seedance native 4K is about $4.90 per 5-second clip. 「Failed or errored requests are never billed」, 据 relaydance.com 官方文档, which matters for bots that retry timed-out tasks. Payments accept USDT and Stripe card. See live per-model rates at relaydance.com/models.

FAQ

How does the bot know when a video is ready? Poll GET /v1/video/generations/{task_id} until status is succeeded or failed, or set metadata.callback_url to receive the final state by POST.

Am I charged if a task fails? No. Failed or errored requests are never billed.

Can I keep my OpenAI SDK? Yes. Set base_url to https://relaydance.com/v1 and send Authorization: Bearer YOUR_API_KEY.

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