API Referencehttps://gw.shineon.dev

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

SettingValue
Base URLhttps://gw.shineon.dev
AuthenticationAuthorization: Bearer sk-gw-…
Content typeapplication/json
Maximum request body64 MB

Store your key in an environment variable:

bash
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:

bash
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.api identifies the API standard: byteplus or minimax.
  • video.endpoint is the correct submission endpoint.
  • pricing.video_tokens_per_1m contains the Seedance resolution buckets currently available to the key.
  • pricing.video_per_unit contains 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

ModelsVariantsAPI standardBilling basis
dreamina-seedance4BytePlus ModelArkVideo tokens
doubao-seedance4BytePlus ModelArkVideo tokens
MiniMax-H31MiniMaxInput + output seconds; excess input images separately

Generating a video

BytePlus ModelArk

MethodPathWhat it does
POST/api/v3/contents/generations/tasksSubmit a task → {"id": "cgt-…"}
GET/api/v3/contents/generations/tasks/{id}Poll one task
GET/api/v3/contents/generations/tasksList your BytePlus tasks
DELETE/api/v3/contents/generations/tasks/{id}501 — generation cannot be cancelled

Submit a text-to-video task:

bash
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
  }'
json
{"id":"cgt-20260820143012-k7m2q"}

Poll it:

bash
curl https://gw.shineon.dev/api/v3/contents/generations/tasks/cgt-20260820143012-k7m2q \
  -H "Authorization: Bearer $KEY"
json
{
  "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:

MethodPathWhat it does
POST/v2/video_generationSubmit 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.

bash
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
json
{"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_exhausted before 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:

json
{
  "error": {
    "message": "What went wrong",
    "type": "invalid_request_error",
    "code": "duration_invalid",
    "param": "duration"
  }
}

code and param are omitted when they are not applicable.

StatuscodeWhat it means
400model_not_foundmodel is not a video model on this gateway.
400model_wrong_apiThe model belongs to the other video API; the message names its endpoint.
400duration_invalidduration must be positive, or -1 where the model may choose.
400resolution_not_availableThe model does not generate the requested resolution.
400tier_not_availableThe resolution exists but is not sold to this account.
400InvalidParameterAn asset:// reference is missing, not owned by this key, not Active, or cannot be used by the selected model.
400callback_not_supportedcallback_url was sent. Poll the task instead.
401invalid_api_keyThe key is missing, unknown, or revoked.
403model_not_allowedThe key is valid but does not allow this model.
404—The task or asset does not exist for this key and API.
429balance_exhaustedThe balance cannot cover the task estimate. Nothing was started.
429QuotaExceededThis key already holds the maximum number of stored assets.
429rate_limit_exceededThe key exceeded its request rate; follow Retry-After.
429concurrency_limit_exceededThe key has too many requests in flight; follow Retry-After.
429account_rate_limit_exceededThe account exceeded its rate across all keys; follow Retry-After.
429account_concurrency_limit_exceededThe account has too many requests in flight; follow Retry-After.
501cancel_not_supportedThe task cannot be cancelled once submitted.
503model_not_pricedThe model has no applicable price in this account's currency.
503no_channel_availableNo enabled channel can serve the model right now.
503billing_unavailableSettlement is temporarily unavailable, so the gateway failed closed.
503gateway_overloadedGateway 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 the Retry-After response header.
  • Do not automatically retry balance_exhausted; add funds or reduce the request first.
  • Retry 502, billing_unavailable, no_channel_available, code-less 503, and gateway_overloaded with exponential backoff and jitter.
  • Do not automatically retry model_not_priced, 400, 401, 403, 404, or 501. 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.