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.
| Method | Path | Description |
|---|---|---|
POST | /v1/videos | Submit a video generation task, returns task_id |
GET | /v1/videos/{task_id} | Query video task status and progress |
GET | /v1/videos/{task_id}/content | Download 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:
- Text models: billed per token (input / output counted separately).
- Video models: billed per second or per request (model dependent).
- Image models: billed per request (model dependent).
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
| Code | Meaning | Suggested Action |
|---|---|---|
400 | Invalid parameters | Check model / prompt / required fields |
401 | Authentication failed | Check the API Key and the Bearer prefix |
404 | Model not found | Use GET /v1/models to confirm the models available to your key |
429 | Rate or quota limited | Reduce concurrency or check your account balance |
500 | Temporary service issue | Retry later; contact support if it persists |
Common Issues and Troubleshooting
- 401: confirm the key is correct and carries the Bearer prefix.
- 404: confirm via
/v1/modelsthat the model is available to your key. - 429: reduce concurrency or check your account balance.
- 500: temporary service issue; retry later and contact support if it persists.