Video generation API
Generate video through the BytePlus ModelArk v3 or MiniMax v2 API standard. Both APIs are asynchronous: submit a task, keep its id, and poll until it reaches a terminal state.
Getting started
| Setting | Value |
|---|---|
| Base URL | https://gw.shineon.dev |
| Authentication | Authorization: Bearer sk-gw-… |
| Content type | application/json |
| Maximum request body | 64 MB |
Store your key in an environment variable:
export KEY="sk-gw-..."
Never expose the key in browser code or commit it to source control.
Model discovery
Always discover models with the key that will make the request:
curl https://gw.shineon.dev/v1/models \
-H "Authorization: Bearer $KEY"
The response is specific to that key. It includes only models that the key may call, that are available through an enabled channel, and that are priced in the account's currency.
For each video model:
video.apiidentifies the API standard:byteplusorminimax.video.endpointis the correct submission endpoint.pricing.video_tokens_per_1mcontains the Seedance resolution buckets currently available to the key.pricing.video_per_unitcontains the MiniMax resolution buckets currently available to the key.
The model pages describe model capabilities. The keys present in
GET /v1/models are the authority for what this key can buy now; do not
hard-code the static tables as an availability check.
Models
| Models | Variants | API standard | Billing basis |
|---|---|---|---|
| dreamina-seedance | 4 | BytePlus ModelArk | Video tokens |
| doubao-seedance | 4 | BytePlus ModelArk | Video tokens |
| MiniMax-H3 | 1 | MiniMax | Input + output seconds; excess input images separately |
Generating a video
BytePlus ModelArk
| Method | Path | What it does |
|---|---|---|
POST | /api/v3/contents/generations/tasks | Submit a task → {"id": "cgt-…"} |
GET | /api/v3/contents/generations/tasks/{id} | Poll one task |
GET | /api/v3/contents/generations/tasks | List your BytePlus tasks |
DELETE | /api/v3/contents/generations/tasks/{id} | 501 — generation cannot be cancelled |
Submit a text-to-video task:
curl https://gw.shineon.dev/api/v3/contents/generations/tasks \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-mini-260615",
"content": [
{
"type": "text",
"text": "a red apple rotating on a white table"
}
],
"resolution": "480p",
"ratio": "16:9",
"duration": 4
}'
{"id":"cgt-20260820143012-k7m2q"}
Poll it:
curl https://gw.shineon.dev/api/v3/contents/generations/tasks/cgt-20260820143012-k7m2q \
-H "Authorization: Bearer $KEY"
{
"id": "cgt-20260820143012-k7m2q",
"model": "dreamina-seedance-2-0-mini-260615",
"status": "succeeded",
"resolution": "480p",
"duration": 4,
"created_at": 1766217600,
"updated_at": 1766217742,
"content": {"video_url": "https://example.com/generated-video.mp4"},
"usage": {"completion_tokens": 197400, "total_tokens": 197400},
"error": null
}
status can be queued, running, succeeded, failed, or cancelled.
Poll every 10–15 seconds until a terminal state. Generation time varies with
the model, duration, resolution, references, and current capacity.
Download a successful result promptly. content.video_url is a short-lived
media URL, not a permanent asset id.
See the model pages for copy-ready image-to-video and video-to-video requests.
MiniMax
MiniMax uses a different route and response envelope:
| Method | Path | What it does |
|---|---|---|
POST | /v2/video_generation | Submit a task → {"task_id": "mmt-…"} |
GET | /v2/query/video_generation/{id} | Poll one task → {"task": {…}} |
See the complete MiniMax-H3 guide. A model submitted to the
wrong video API returns model_wrong_api and names the correct endpoint.
Listing tasks
Task listing exists only on the BytePlus API and never includes MiniMax tasks.
curl -G https://gw.shineon.dev/api/v3/contents/generations/tasks \
-H "Authorization: Bearer $KEY" \
-d page_size=20 \
-d page_num=1 \
-d filter.status=succeeded \
-d filter.model=dreamina-seedance-2-0-mini-260615
{"total":41,"items":[]}
page_size is 1–50 (default 20), and page_num is 1-based.
filter.status accepts queued, running, succeeded, or failed.
filter.task_ids accepts a comma-separated list or repeated parameters.
An unrecognised filter value matches nothing rather than widening the result.
Billing
A failed or cancelled generation is free. A successful task is charged once, even if it is polled more than once:
- Submission holds a conservative estimate against the account balance.
A request the available balance cannot cover is refused with
balance_exhaustedbefore generation starts. - The first poll that observes a terminal result settles the task. If the task is never polled, the gateway settles it in the background.
- The console records a submission row and a terminal settlement row. Successful settlement carries the charge; failed settlement has zero cost.
Seedance is billed per one million video tokens. Its rate is selected by output
resolution and whether the input contains a reference video. Reference
images do not select a with_ref bucket. generate_audio controls the output
but does not change the gateway's current billing bucket.
MiniMax-H3 is billed on input-video seconds plus output-video seconds, at the
selected resolution's per-unit rate. Input images beyond the first five add
per-image units. The completed task reports these quantities in task.usage.
Exact rates are account-specific. Read them from GET /v1/models; the docs do
not publish static prices.
Errors
Gateway-generated errors use this shape:
{
"error": {
"message": "What went wrong",
"type": "invalid_request_error",
"code": "duration_invalid",
"param": "duration"
}
}
code and param are omitted when they are not applicable.
| Status | code | What it means |
|---|---|---|
400 | model_not_found | model is not a video model on this gateway. |
400 | model_wrong_api | The model belongs to the other video API; the message names its endpoint. |
400 | duration_invalid | duration must be positive, or -1 where the model may choose. |
400 | resolution_not_available | The model does not generate the requested resolution. |
400 | tier_not_available | The resolution exists but is not sold to this account. |
400 | InvalidParameter | An asset:// reference is missing, not owned by this key, not Active, or cannot be used by the selected model. |
400 | callback_not_supported | callback_url was sent. Poll the task instead. |
401 | invalid_api_key | The key is missing, unknown, or revoked. |
403 | model_not_allowed | The key is valid but does not allow this model. |
404 | — | The task or asset does not exist for this key and API. |
429 | balance_exhausted | The balance cannot cover the task estimate. Nothing was started. |
429 | QuotaExceeded | This key already holds the maximum number of stored assets. |
429 | rate_limit_exceeded | The key exceeded its request rate; follow Retry-After. |
429 | concurrency_limit_exceeded | The key has too many requests in flight; follow Retry-After. |
429 | account_rate_limit_exceeded | The account exceeded its rate across all keys; follow Retry-After. |
429 | account_concurrency_limit_exceeded | The account has too many requests in flight; follow Retry-After. |
501 | cancel_not_supported | The task cannot be cancelled once submitted. |
503 | model_not_priced | The model has no applicable price in this account's currency. |
503 | no_channel_available | No enabled channel can serve the model right now. |
503 | billing_unavailable | Settlement is temporarily unavailable, so the gateway failed closed. |
503 | gateway_overloaded | Gateway capacity is temporarily exhausted; follow Retry-After. |
502 / 503 | — | An upstream dependency is temporarily unavailable. |
Retrying requests
- For a rate or concurrency
429, wait for the number of seconds in theRetry-Afterresponse header. - Do not automatically retry
balance_exhausted; add funds or reduce the request first. - Retry
502,billing_unavailable,no_channel_available, code-less503, andgateway_overloadedwith exponential backoff and jitter. - Do not automatically retry
model_not_priced,400,401,403,404, or501. Change the request or account configuration first. - A video submission is not idempotent. If the connection fails after the body was sent and no task id was received, check the console before submitting again to avoid starting a duplicate task.