Create text-to-video or image-to-video tasks with your personal API Key. Supported values, reference limits, and model-specific constraints are listed below.
Create a video task
POST /openapi/v1/videos/generationsThe request returns taskId immediately; read videos[].url from the detail endpoint after completion.
curl -X POST 'https://prompthub.xin/api/openapi/v1/videos/generations' \
-H 'Authorization: Bearer phk_你的API密钥' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "雨夜霓虹街道,镜头缓慢推进",
"model": "platform-video-model-id",
"clientRequestId": "video_demo_001",
"mode": "text_to_video",
"parameters": {
"aspectRatio": "16:9",
"duration": 10,
"resolution": "720p",
"generateAudio": true
}
}'素材
Generation endpoints accept URLs in JSON only; they do not accept file bodies, Base64, or multipart uploads.
Use a PromptHub OSS URL or another URL reachable by the backend and model directly in the asset array.
references[].url = https://...Get an upload signature, upload directly to PromptHub OSS, then put publicUrl or standardUrl from the response in the asset array.
POST /openapi/v1/videos/uploads/signatureThe signature endpoint only receives contentType. Use host, policy, signature, accessKeyId, and key from its response for the OSS form upload. Images are limited to 20 MB; video/audio also have duration and model limits.
curl -X POST 'https://prompthub.xin/api/openapi/v1/videos/uploads/signature' \
-H 'Authorization: Bearer phk_你的API密钥' \
-H 'Content-Type: application/json' \
-d '{"contentType":"video/mp4"}'
# 使用响应 data.host、data.policy、data.signature、data.accessKeyId、data.key 直传 OSS
curl -X POST '<data.host>' \
-F "key=<data.key>" \
-F "policy=<data.policy>" \
-F "OSSAccessKeyId=<data.accessKeyId>" \
-F "Signature=<data.signature>" \
-F "Content-Type=video/mp4" \
-F "file=@./reference.mp4"01
The public protocol accepts platform model IDs and canonical parameters only; internal routing details are not exposed.
| Field | Required | Type | Description |
|---|---|---|---|
| prompt | Yes | string | Video description, actions, and camera direction. |
| model | Yes | string | Platform model ID from the video model list. |
| clientRequestId | Yes | string | Client idempotency ID; retries do not charge twice. |
| mode | No | enum | text_to_video / image_to_video |
| references | No | array | Mixed reference assets with type=image/video/audio. |
| parameters | No | object | aspectRatio, duration, resolution, generateAudio, referenceType, and more. |
02
Data is loaded from the platform model catalog and contains only callable platform model IDs and public capabilities, without internal routing or binding details.
| Platform model | Platform model ID | Status | mode | aspectRatio | duration | resolution | Reference limits |
|---|---|---|---|---|---|---|---|
| Loading the platform model catalog... | |||||||
Values outside a model's capability matrix are rejected instead of being silently ignored.
Audio references require referenceAudios=true; generateAudio support is model-dependent.
Use the values in the platform model table above
Image-to-video requires an image reference; video/audio references must satisfy count, size, and duration limits.
@图片1 → references[type=image][0]
@图片2 → references[type=image][1]
@视频N → references[type=video][N-1]
@音频N → references[type=audio][N-1]
The canonical tags are @图片N, @视频N, and @音频N. Each starts at 1 within its own media type; use type and role to describe the asset and its purpose.
{
"prompt": "脸型参考@图片1,服装参考@图片2;动作参考@视频1,音乐使用@音频1",
"references": [
{ "type": "image", "url": "https://example.com/face.jpg", "role": "character" },
{ "type": "video", "url": "https://example.com/motion.mp4", "role": "motion_reference" },
{ "type": "image", "url": "https://example.com/outfit.jpg", "role": "wardrobe" },
{ "type": "audio", "url": "https://example.com/music.mp3", "role": "background_music" }
]
}03
Replace taskId in the path and poll until status is completed or failed.
curl 'https://prompthub.xin/api/openapi/v1/videos/generations/{taskId}' \
-H 'Authorization: Bearer phk_你的API密钥'