Laravel queue jobs for AI video: PHP integration with the RelayDance API

To integrate RelayDance AI video generation into Laravel, dispatch a queued job that submits POST /v1/video/generations with your model, prompt, and seconds, then poll GET /v1/video/generations/{task_id} until the status is succeeded or failed. RelayDance is OpenAI-compatible, so set base_url to https://relaydance.com/v1 and authenticate with a Bearer key. Long generation times fit Laravel queues well because polling and webhook callbacks run outside the request cycle.

How to configure the RelayDance client in Laravel

Configure RelayDance by pointing your existing OpenAI SDK or HTTP client at the RelayDance base URL. According to the official relaydance.com/docs, "Set base_url to https://relaydance.com/v1 and keep your OpenAI SDK". In Laravel, store the key in config/services.php and read it from your environment. Authentication uses the header Authorization: Bearer YOUR_API_KEY, and keys are created at the RelayDance console. Because the protocol is OpenAI-compatible, you avoid a BytePlus enterprise account or KYC. See the full endpoint reference at https://relaydance.com/docs for request and metadata fields including ratio, resolution, generate_audio, and callback_url.

How to build the queue job that submits and polls

Build a queued job that submits the task, then polls or waits for a webhook. Follow these numbered steps:

  1. Dispatch a job with the model, prompt, and seconds (clips up to 15 seconds).
  2. Send POST /v1/video/generations, adding metadata.content[] for reference media cited as @image1 to @imageN (up to 9 reference images, 3 reference videos, and 3 audio tracks per request).
  3. Read the returned task_id.
  4. Poll GET /v1/video/generations/{task_id} until status is succeeded or failed, or set metadata.callback_url so the final state is POSTed to your server.
  5. Store the returned video url and mark the job complete.

Webhook mode reduces polling load by delivering the final state to a Laravel route directly.

How RelayDance billing affects queue retry logic

RelayDance bills pay-as-you-go per generated video, so retry logic does not carry unexpected cost for failures. According to the official relaydance.com docs, "Failed or errored requests are never billed", which means Laravel's automatic retry on a transient error will not double-charge you. Live per-model rates are published at https://relaydance.com/models. Current examples include Seedance 2.0 at about $0.190 per second for 720p and about $0.470 per second for 1080p, Seedance Fast at about $0.152 per second, and Seedance native 4K at about $4.90 per 5-second clip. Payments accept USDT and Stripe card.

Model and price reference for planning jobs

Use the table below to estimate cost per queued job from published rates.

OptionRateUnit
Seedance 2.0 720pabout $0.190per second
Seedance 2.0 1080pabout $0.470per second
Seedance Fastabout $0.152per second
Seedance native 4Kabout $4.90per 5-second clip
gpt-image-2 (image-to-image)from about CNY 0.035per input

For gpt-image-2, image output is free and only input is billed, and 4K and 1K output cost the same. Confirm all values at https://relaydance.com/models before pricing jobs.

FAQ

Do I need a BytePlus enterprise account to use Seedance through Laravel? No. RelayDance provides direct OpenAI-compatible access to Seedance with no BytePlus enterprise account or KYC required.

What happens to my Laravel job if a request fails? The status returns failed and failed or errored requests are never billed, so retrying is cost-safe.

Can a single request use reference media? Yes. Place media in metadata.content[] and cite them as @image1 to @imageN, up to 9 reference images, 3 reference videos, and 3 audio tracks per request.

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