HomeConsoleModel CatalogAI StudioAPI DocsAbout中文

Video Generation API Guide

This page is the video-specific documentation and is related to the full integration guide. All endpoints are based on the real backend and the examples can be reproduced directly.

E. Video Generation API

This section is the video-specific documentation and is related to the video API guide.

Video Generation Endpoints

Video generation is submitted as asynchronous tasks and supports text-to-video and image-to-video.

MethodPathDescription
POST/v1/videosSubmit a video generation task, returns task_id
GET/v1/videos/{task_id}Query video task status and progress
GET/v1/videos/{task_id}/contentDownload the generated video stream

Request Example

curl https://shenmeai.vip/v1/videos \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"model":"minimax-h3","prompt":"a cat running on the grass"}'

Response Example

{"task_id":"vid_xxx","status":"processing"}

Text-to-Video

Submit via POST /v1/videos; the prompt describes the video content and the response returns a task_id.

Image-to-Video

Upload a first frame or reference image to drive video generation; details follow each model card's reference-asset description.

Reference Uploads / Video References

Reference images, reference videos and reference audio are supported (quantity limits depend on the model), submitted via multipart.

Duration and Resolution

Duration and resolution tiers vary by model; check the corresponding model card before calling.

Asynchronous Submission

Submission returns a task_id immediately; the task is generated in the background.

Querying Task Status

Query status and progress via GET /v1/videos/{task_id}.

Fetching the Final Video

Once generation completes, download the video stream via GET /v1/videos/{task_id}/content; the query response also includes a direct link to the result.

Failure Handling

Failed tasks are settled according to the actual billing rules; error codes are listed in section G. For models that allow retries, submit again later.

G. Billing and Error Codes

Billing Units

Different models are billed differently:

Checking Prices

Current model prices and billing units are published in the model catalog and via the public pricing endpoint GET /api/pricing.

When You Are Charged

Tasks are charged based on the actual call parameters once accepted. Failed tasks are settled according to the actual billing rules (see model cards and the refund policy at /refund).

Refunds for Failed Tasks

Billing for failed tasks follows the refund policy; the actual billing rules prevail.

Request IDs

When reporting an issue, provide the request ID and task ID so it can be located quickly.

Error Codes

CodeMeaningSuggested Action
400Invalid parametersCheck model / prompt / required fields
401Authentication failedCheck the API Key and the Bearer prefix
404Model not foundUse GET /v1/models to confirm the models available to your key
429Rate or quota limitedReduce concurrency or check your account balance
500Temporary service issueRetry later; contact support if it persists

Common Issues and Troubleshooting