HaryAI API: video (Seedance 2.5)
Video generation is an asynchronous task: submit, get a task id, poll until
it finishes, then download. Two formats are supported: BytePlus ModelArk (the
official Seedance format, the same as Volcengine Ark) and OpenAI Videos. Use the same API key as for
chat: Authorization: Bearer <HARYAI_KEY>. Get the key from
https://haryai.com/en/dashboard, or, as an agent, sign up with
https://haryai.com/AUTH.md
Models
| Model name | Resolutions | Duration |
|---|---|---|
dreamina-seedance-2-5-260628 |
480p, 720p, 1080p | up to 30 s |
dreamina-seedance-2-5-flash-261115 |
480p, 720p | up to 30 s |
dreamina-seedance-2-5-260628-unlock |
480p, 720p, 1080p | up to 30 s |
dreamina-seedance-2-5-flash-261115-unlock |
480p, 720p | up to 30 s |
The -unlock names are the same models with fewer content limits, at a
higher price (see https://haryai.com/en/pricing). Upstream still refuses
some outputs, for example generated audio it judges copyrighted; a refused
task is refunded in full.
Durations run from 4 to 30 seconds. Write duration (or seconds): without it the longest clip is held until the task finishes.
Video is paid from the balance only; a Coding Plan does not cover it.
ModelArk format
Base URL: https://api.haryai.com/api/v3
1. Submit
curl https://api.haryai.com/api/v3/contents/generations/tasks \
-H "Authorization: Bearer $HARYAI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-5-260628",
"content": [{"type": "text", "text": "A cat dancing in the rain"}],
"duration": 5,
"resolution": "720p",
"ratio": "16:9"
}'
Reply: {"id": "<task id>"}
modelandcontent(at least one item) are required. Addimage_urlorvideo_urlitems tocontentfor image or video references.- Other ModelArk fields (
duration,resolution,ratio,generate_audio, …) are passed to Seedance unchanged.resolutionmust be one the model offers. - Refused:
callback_url,draft: true,draft_taskitems. Poll instead. - References, and reusing a video you generated: see References below.
2. Poll
curl https://api.haryai.com/api/v3/contents/generations/tasks/<task id> \
-H "Authorization: Bearer $HARYAI_KEY"
status is queued, running, succeeded or failed. Poll every few
seconds until it is succeeded or failed. Cancelled or expired tasks
show as failed. A failed task has error: {code, message}.
3. Download
On succeeded, content.video_url is the video. The link is on
api.haryai.com, needs no API key, and expires after 24 hours (30 days
once it has been used as a reference). Download it before then.
curl -L -o video.mp4 "<content.video_url>"
usage.completion_tokens and usage.total_tokens show the billing tokens.
4. List
curl "https://api.haryai.com/api/v3/contents/generations/tasks?page_size=20&filter.status=succeeded" \
-H "Authorization: Bearer $HARYAI_KEY"
Your tasks from the last 7 days, newest first, as ModelArk lists them:
{"items": [...], "total": N}. Each item is what polling that task
returns. Filters: filter.status, filter.model, and filter.task_ids
(repeat it for several ids). page_num and page_size run from 1 to 500
(defaults 1 and 20). If a submit lost its reply, list your recent tasks to
see whether it was created.
References
- Reference images, videos and audio can be URLs or base64
data:URLs (in the OpenAI format also uploaded files). Adata:URL or an upload is stored on our side and sent upstream as a link, so all of these work. - Keep reference images around 2048 px on the long side, as JPEG. Upstream takes 300 to 6000 px per side, an aspect ratio from 0.4 to 2.5 and under 30 MB each. Bigger files only make the request slower to send, and some clients refuse a request over 64 MB before sending it.
- To build on a video you generated, put its
content.video_url(theapi.haryai.comlink) in avideo_urlitem. Nothing is downloaded or uploaded again: the first time the link is used as a reference we keep a copy, and from then on the link works for 30 days, past the usual 24 hours. The first reuse has to be within 24 hours of generating it.
OpenAI format
Base URL: https://api.haryai.com/v1
# 1. Submit (JSON or multipart)
curl https://api.haryai.com/v1/videos \
-H "Authorization: Bearer $HARYAI_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"dreamina-seedance-2-5-260628","prompt":"A cat dancing in the rain","seconds":5,"size":"1280x720"}'
# 2. Poll
curl https://api.haryai.com/v1/videos/<id> -H "Authorization: Bearer $HARYAI_KEY"
# 3. Download (needs the key)
curl -L -o video.mp4 https://api.haryai.com/v1/videos/<id>/content \
-H "Authorization: Bearer $HARYAI_KEY"
size is WIDTHxHEIGHT; the longer side picks the tier: 1920 or more is
1080p, 1280 or more is 720p, anything smaller is 480p.
- Fields:
prompt,seconds(orduration; 1–3600 or -1),size,metadata. Reference images go ininput_reference,imageorimages[], as URLs, or as uploaded files in a multipart body (input_referenceorimage[];first_frameandlast_framefor a first and last frame). Reference videos and audio are URLs only, inmetadata.content. Any other ModelArk field goes inmetadata. statusisqueued,in_progress,completedorfailed.
Billing
- Billing tokens = (input video seconds + output seconds) × width × height × 24 / 1024. Reference images add nothing.
- On submit, the price is held from the balance. Without
duration(or with -1), the hold is for 30 s, at the highest resolution if none is given; a low balance can then reject the request. Always setduration. - When the task finishes the charge is settled to the real usage. A failed or timed-out task is refunded in full.
- Prices: https://haryai.com/en/seedance-api-pricing
Errors
Key, model and balance errors use the chat shape
{"error":{"message":"…","type":"new_api_error","code":"…"}}:
| Status | Code | Meaning |
|---|---|---|
| 401 | (empty) | Missing or invalid key |
| 400 / 503 | model_not_found |
Model not available to your account / not available now |
| 403 | insufficient_user_quota |
Balance too low for the hold (set duration to lower it) |
After that, ModelArk-format errors are {"error":{"code":"…","message":"…"}}:
| Status | Code | Meaning |
|---|---|---|
| 400 | InvalidParameter |
Bad field, e.g. an unsupported resolution or a refused field |
| 401 | AuthenticationError |
|
| 403 | AccessDenied |
|
| 404 | NotFound |
Task not found (Task not found) |
| 429 | RateLimitExceeded |
The model provider is busy; retry after a few seconds |
| 5xx | InternalServiceError |
Task request failed; retry later |
Content moderation: the task ends failed with the upstream error.code
and message, and the hold is refunded. Change the prompt or the
reference and submit again.
A /v1/videos submit that fails returns a non-2xx status with an error
message; read the message, it names the field.
/v1/videos/<id>/content for an unknown task: 404
{"error":{"message":"Task not found","type":"invalid_request_error"}}.







