接口
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/generateTask/sora-2-pro | 创建生成任务 |
| GET | /api/v1/statusTask/sora-2-pro | 查询任务状态 |
认证
所有请求需在请求头中携带 API Key:Request Body
Parameters
async (polling) or callback (webhook)
Callback URL, required when request_type=callback (conditional)
Routing strategy. Only official is supported; always set provider=official explicitly.
Model input parameters
text-to-video— Generate video from text promptimage-to-video— Generate video from reference image
Example
Text-to-VideoResponse
POST /api/v1/generateTask/sora-2-pro
ReturnstaskId on success for subsequent status queries.
Success:
GET /api/v1/statusTask/sora-2-pro
Query task execution status and results viataskId.
Status Response Fields
Unique task identifier.
Current task state:
pending, processing, success, or failed.JSON string containing
resultUrls array. Only present on success. Parse with JSON.parse().Error code. Only present when
state is failed. See Error Codes.Human-readable error message. Only present when
state is failed.Task creation timestamp (Unix milliseconds).
Task completion timestamp (Unix milliseconds).
Processing duration in milliseconds.
Error Codes
| Code | Description |
|---|---|
| 400 | Invalid parameters or request error |
| 401 | Invalid or missing API Key |
| 429 | Rate limit exceeded |
| Fail Code | Description |
|---|---|
CONTENT_VIOLATION | Content violates safety guidelines |
INVALID_IMAGE_URL | Cannot access provided image URL |
速率限制
| Limit | Value |
|---|---|
| Requests | 60 / minute |
| Concurrent tasks | 10 |
429 error. Wait and retry.
Tips
- Generation time: Average ~3 minutes per video. Submit task, wait 120 seconds, then poll every 5 seconds.
- Routing recommendation: Always include
provider=officialexplicitly in request body. - Callback mode: Due to long generation times, strongly recommend using
callbackmode. - Video expiration: Result URLs are valid for 15 days. Download promptly.
- Content moderation: Prompts must comply with content safety guidelines. Violations return
CONTENT_VIOLATION. - Image formats:
image_urlssupports JPG, PNG, WebP, max 10MB per image. - Duration options: Use
4,8, or12seconds depending on preview vs final output needs. - Official route duration policy: Under
provider=official, duration values should be explicitly set to4,8, or12. - Size vs Resolution:
sizeis used in text-to-video mode:720*1280(portrait),1280*720(landscape),1024*1792,1792*1024resolutionis used in image-to-video mode:720por1080p