算力路由器算力路由器
AI Model InterfaceVideosSora format

Create Video

OpenAI compatible video generation API.

Reference documentation: https://platform.openai.com/docs/api-reference/videos/create

OpenAI Video Call

This general entry point is currently used for sora-2 and sora-2-pro. After creation, use GET /v1/videos/{task_id} to query, and the proxy address for the video file is GET /v1/videos/{task_id}/content.

curl "$BASE_URL/v1/videos" \
  -H "Authorization: Bearer $NODEKEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "prompt": "A handheld shot through a morning coffee shop, sunlight sweeping across the table from the window",
    "seconds": "5",
    "size": "1280x720"
  }'

curl "$BASE_URL/v1/videos/task_xxx" \
  -H "Authorization: Bearer $NODEKEY_API_KEY"

Form upload reference input is also supported; reference images use input_reference. sora-2 supports 720x1280 and 1280x720, while sora-2-pro additionally supports 1792x1024 and 1024x1792.

POST
/v1/videos

Authorization

BearerAuth

AuthorizationBearer <token>

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

In: header

Request Body

multipart/form-data

model?string

模型/风格 ID

prompt?string

文本描述提示词

image?string

图片输入 (URL 或 Base64)

duration?number

视频时长(秒)

width?integer

视频宽度

height?integer

视频高度

fps?integer

视频帧率

seed?integer

随机种子

n?integer

生成视频数量

response_format?string

响应格式

user?string

用户标识

metadata?

扩展参数 (如 negative_prompt, style, quality_level 等)

Response Body

application/json

application/json

curl -X POST "https://nodekey.xinghanyun.cn/v1/videos" \  -F model="kling-v1" \  -F prompt="宇航员站起身走了" \  -F image="https://example.com/image.jpg" \  -F duration="5" \  -F width="1280" \  -F height="720" \  -F fps="30" \  -F seed="20231234" \  -F n="1" \  -F response_format="url" \  -F user="user-1234" \  -F metadata="{}"
{
  "id": "string",
  "object": "string",
  "model": "string",
  "status": "string",
  "progress": 0,
  "created_at": 0,
  "seconds": "string",
  "completed_at": 0,
  "expires_at": 0,
  "size": "string",
  "error": {
    "message": "string",
    "code": "string"
  },
  "metadata": {}
}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": "string",
    "code": "string"
  }
}

Last updated on