Language
TensorFusion Docs

Dreamina video generation

The Dreamina model matrix, a full request-parameter reference, and the submit-poll-download flow.

Dreamina is an asynchronous video task API: submit a task, get a task ID, poll for progress, and download the MP4 when it completes. One ai:video Key covers the whole flow — the gateway handles authentication, routing, billing, and storing the finished file.

Choosing a model

The model ID encodes everything you need, so you rarely have to look anything up:

dreamina-seedance-2.0-fast : 720p -ref
└──────── model family ───┘ └tier┘ └input mode┘
  • Family2.0-fast is quicker and cheaper per second; 2.0 has better quality and is the only family offering 1080p and 4K.
  • Tier — output resolution, which also sets the per-second price.
  • -ref suffix — a -ref model is image-to-video and requires input_reference; without it the model is text-to-video. These are two separate model IDs, not a toggle.

A text-to-video model does not become image-to-video just because you passed input_reference — the reference is ignored upstream. To use a reference frame, the model ID must end in -ref.

Model matrix

Billed per second of video (meter video_seconds, unit: second). Pricing is not listed here — the model discovery and catalog endpoint is the authoritative source for your organization's actual rate. Models your organization has not enabled return 403.

Model IDInputOutput tier
dreamina-seedance-2.0-fast:480pText-to-video480p
dreamina-seedance-2.0-fast:480p-refImage-to-video480p
dreamina-seedance-2.0-fast:720pText-to-video720p
dreamina-seedance-2.0-fast:720p-refImage-to-video720p
dreamina-seedance-2.0:480pText-to-video480p
dreamina-seedance-2.0:480p-refImage-to-video480p
dreamina-seedance-2.0:720pText-to-video720p
dreamina-seedance-2.0:720p-refImage-to-video720p
dreamina-seedance-2.0:1080pText-to-video1080p
dreamina-seedance-2.0:1080p-refImage-to-video1080p
dreamina-seedance-2.0:4kText-to-video4K
dreamina-seedance-2.0:4k-refImage-to-video4K
dreamina-seedance-2.0:testIntegration testingLowest

2.0-fast:480p is the cheapest production tier; 2.0:test exists only to validate wiring and should not be used for real output.

Which one to pick

  • Validating the integrationdreamina-seedance-2.0:test
  • High volume, cost sensitivedreamina-seedance-2.0-fast:480p
  • Standard deliverable outputdreamina-seedance-2.0:720p
  • Need a reference frame / consistent subject → switch to -ref at the same tier and pass input_reference
  • 1080p / 4K → only the 2.0 family offers them

Before you start

Create a Key in the ai.tos.run console and grant it the ai:video scope:

export TOS_API_KEY="gk_YOUR_KEY"

Every request uses:

Authorization: Bearer $TOS_API_KEY

Endpoints

OperationEndpoint
Dedicated Dreamina create / poll / downloadPOST /dreamina/v1/video · GET /dreamina/v1/video/{task_id} · GET /dreamina/v1/video/{task_id}/content
OpenAI-compatible create / poll / downloadPOST /v1/videos · GET /v1/videos/{task_id} · GET /v1/videos/{task_id}/content

Both entries share task, authentication, billing, and response contracts. The dedicated entry always uses Dreamina; the OpenAI-compatible entry routes by model and is the recommended choice for new integrations.

Request parameters

The gateway validates only model and promptevery other field is forwarded to the Dreamina upstream as-is. The table marks who handles each field, so you can tell a gateway rejection from an upstream one.

Send only model; do not include any service-selection field. The gateway picks a service from the API Key organization's routing policy and performs failover.

FieldTypeRequiredHandled byNotes
modelstringYesGatewayFull ID from the matrix, including the :tier and optional -ref suffix
promptstringYesGatewayEmpty returns 400 immediately; nothing is sent upstream
input_referencestringYes for -ref modelsGateway rewritesOne publicly reachable http(s) URL. The gateway renames it to image before forwarding
durationnumberNoForwarded + billedVideo length in seconds. Aliases duration_seconds and seconds, resolved in that order
ratiostringNoForwardedAspect ratio, e.g. "16:9". Accepted values are decided upstream

duration also drives billing: charges are video_seconds × unit price. If none of the three aliases yields a valid duration, the gateway bills 5 seconds. Dreamina currently requires at least 4 seconds.

Fields not listed here (new upstream parameters, for example) travel with the request body untouched — the gateway neither validates nor rewrites them.

Text-to-video

curl --noproxy '*' "https://ai.tos.run/dreamina/v1/video" \
  -H "Authorization: Bearer $TOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dreamina-seedance-2.0-fast:480p",
    "prompt": "A product showcase video with a slow dolly-in",
    "duration": 4,
    "ratio": "16:9"
  }'

Keep the id from the response — polling and downloading both use this task ID:

{
  "id": "job_123456",
  "task_id": "job_123456",
  "object": "video",
  "model": "dreamina-seedance-2.0-fast:480p",
  "status": "queued",
  "progress": 0,
  "metadata": {}
}

Image-to-video

Switch to a -ref model ID and pass one publicly reachable http:// or https:// URL in input_reference.

curl --noproxy '*' "https://ai.tos.run/dreamina/v1/video" \
  -H "Authorization: Bearer $TOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dreamina-seedance-2.0-fast:480p-ref",
    "prompt": "Animate the subject from the reference frame into a natural product showcase",
    "input_reference": "https://example.com/product-front.png",
    "duration": 4
  }'

The reference must be:

  • A string, not an array. An array returns 400 参考图片格式无效,请提供一张图片. Dreamina accepts exactly one reference image per task.
  • A publicly downloadable URL. Material-library references are not supported — do not pass asset://....
  • Reachable for the whole run. The upstream fetches the URL while generating; an early expiry fails the task.

The response format matches text-to-video.

OpenAI-compatible entry

The same case works against the standard /v1/videos with an identical body:

curl --noproxy '*' "https://ai.tos.run/v1/videos" \
  -H "Authorization: Bearer $TOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dreamina-seedance-2.0-fast:480p-ref",
    "prompt": "The runner moves left to right with alternating strides and natural arm swing; no freeze frame.",
    "input_reference": "https://example.com/runner.png",
    "duration": 4
  }'
{
  "id": "97120312-8053-4c7b-b1dd-4c392dddbeb6",
  "task_id": "97120312-8053-4c7b-b1dd-4c392dddbeb6",
  "object": "video",
  "model": "dreamina-seedance-2.0-fast:480p-ref",
  "status": "queued",
  "progress": 20,
  "created_at": 1785923067,
  "expires_at": 1786527867,
  "metadata": {}
}

Polling and download

Response fields

FieldNotes
id / task_idGateway task ID, used for polling and download. Distinct from the upstream task ID — do not mix them
statusqueuedprocessingcompleted / failed
progress0–100. Display only; never use it to decide a task is done
created_at / completed_atUnix seconds
expires_atRetention deadline; metadata.url stops serving after it
metadata.urlPresent once status is completed — the gateway-side output URL

status is the only terminal-state signal: completed or failed.

curl --noproxy '*' "https://ai.tos.run/dreamina/v1/video/job_123456" \
  -H "Authorization: Bearer $TOS_API_KEY"
{
  "id": "job_123456",
  "task_id": "job_123456",
  "object": "video",
  "model": "dreamina-seedance-2.0-fast:480p-ref",
  "status": "completed",
  "progress": 100,
  "completed_at": 1785923670,
  "metadata": {
    "url": "https://ai.tos.run/api/files/serve/generated-videos/job_123456/output.mp4"
  }
}

Downloading the result

Once complete, download the stored MP4 through the gateway and confirm the size from the actual byte count:

curl --noproxy '*' -L "https://ai.tos.run/dreamina/v1/video/job_123456/content" \
  -H "Authorization: Bearer $TOS_API_KEY" \
  -o output.mp4
wc -c < output.mp4

The content endpoint returns video/mp4. While the task is still running it returns 409 — keep polling the same task ID. On the OpenAI-compatible entry, swap the path for /v1/videos/{task_id}/content.

metadata.url also works directly as a server URL; the download size comes from the actual Content-Length response header. Output is retained for a limited window — collect it before expires_at.

Errors and retries

StatusMeaningWhat to do
400Empty prompt, invalid reference format, or an upstream-rejected parameterFix the request per the response message; do not retry
401Key missing, invalid, or revokedCheck the Authorization header
403Key lacks ai:video, or the organization has not enabled the modelVerify Key scope and model access in the console
409Task not finished yetKeep polling the same task ID
502 / 503Video service temporarily unavailableRetry with exponential backoff

On this page