APIMPAPIMP
User GuideAI APIImage APIVideo APIPublic API

sora-2

Submit an async sora-2 / sora-2-pro video generation task. Returns a task_id to poll via the status endpoint.

POST
/api/generate/submit

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

In: header

Request Body

application/json

model*string

Sora 模型名。sora-2-pro 支持 1792x1024 / 1024x17921024p / 1080p 高档,计费更高。

Value in"sora-2" | "sora-2-pro"
prompt*string

视频描述(必填,非空)。建议英文,描述场景 / 动作 / 风格。

size?string

视频分辨率,pixel 形态 WxHsora-2 仅接 720x1280 / 1280x720sora-2-pro 另加 1792x1024 / 1024x1792

duration?integer

视频时长,单位为秒。范围 1..60,默认 4。

Range1 <= value <= 60
image?string

首帧参考图 URL(image-to-video 便捷入口)。

callback_url?string

任务终态时由平台主动 POST 的 HTTPS 回调地址(可选)。

Formaturi
[key: string]?never

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.apimp.ai/api/generate/submit" \  -H "Content-Type: application/json" \  -d '{    "model": "sora-2",    "prompt": "A red panda riding a skateboard, cinematic lighting"  }'
{
  "code": 200,
  "data": {
    "task_id": "task_2BvCWmHzG6sJxK4tQpAr8M9nZyYfRdLs",
    "status": "not_started",
    "created_time": "2026-06-18T09:21:26",
    "error_message": null
  }
}

{
  "code": 400,
  "error": {
    "message": "field `prompt` is required",
    "type": "invalid_request_error"
  }
}

{
  "code": 400,
  "error": {
    "message": "string",
    "type": "invalid_request_error"
  }
}
{
  "code": 400,
  "error": {
    "message": "string",
    "type": "invalid_request_error"
  }
}
{
  "code": 400,
  "error": {
    "message": "string",
    "type": "invalid_request_error"
  }
}
{
  "code": 400,
  "error": {
    "message": "string",
    "type": "invalid_request_error"
  }
}

How is this guide?

Last updated on