API Key鉴权,严格限定创建Key与用户,普通会话不可替代。queued/in_progress/completed/failed/unknown;未知执行或费用继续保留占款,不能当成失败退款。未结算不显示completed,状态查询不调用供应商,也不返回供应商URL或凭据。 JSON或multipart;省略时长/尺寸默认5秒与1280x720,尺寸必须匹配所选模型能力及明确价格。只发送一次;同Key、原意图和规范化输入跨JSON/multipart/普通任务接口重放复用原任务。PNG参考时保留reference_size,横竖不匹配400,不接受外部URL。
Authentication
API Key. Session/administrative writes are not executed in the public Playground. model must be a current public name. Text placeholders prepare a body for review; replace image/video placeholders according to current specifications.
Endpoint
curl --request POST 'https://api.oneaster.ai/v1/videos' \
--header 'Authorization: Bearer '"$ONEASTER_API_KEY" \
--header 'Idempotency-Key: '"$ONEASTER_INTENT" \
--header 'Content-Type: application/json' \
--data '{
"model": "YOUR_VIDEO_MODEL_NAME",
"prompt": "A white ceramic mug on an oak table",
"seconds": "5",
"size": "1280x720"
}'
Parameters
- Idempotency-Key (header, Required): {"type":"string","minLength":1,"maxLength":100}
Request JSON Schema
application/json
{
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"model": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "管理员已配置的公开视频模型名称;不按名称猜供应商。"
},
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 20480,
"description": "上限由所选模型进一步校验。"
},
"seconds": {
"oneOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 30
},
{
"type": "string",
"pattern": "^(?:[1-9]|[12][0-9]|30)$"
}
],
"default": "5"
},
"size": {
"type": "string",
"enum": [
"854x480",
"480x854",
"640x480",
"480x640",
"480x480",
"1120x480",
"480x1120",
"1280x720",
"720x1280",
"960x720",
"720x960",
"720x720",
"1680x720",
"720x1680",
"1920x1080",
"1080x1920",
"1440x1080",
"1080x1440",
"1080x1080",
"2520x1080",
"1080x2520",
"3840x2160",
"2160x3840",
"2160x2160",
"2880x2160",
"2160x2880",
"5040x2160",
"720x480",
"480x720",
"1080x720",
"720x1080",
"1620x1080",
"1080x1620"
],
"default": "1280x720",
"description": "映射到实际KIE分辨率/画幅;以模型已定价能力为准,不保证产物实测像素。"
},
"generate_audio": {
"type": "boolean"
},
"video_task_id": {
"type": "string",
"format": "uuid"
},
"character_orientation": {
"enum": [
"video",
"image"
]
}
},
"required": [
"model",
"prompt"
]
}
}
multipart/form-data
{
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"model": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "管理员已配置的公开视频模型名称;不按名称猜供应商。"
},
"prompt": {
"type": "string",
"minLength": 1,
"maxLength": 20480,
"description": "上限由所选模型进一步校验。"
},
"seconds": {
"oneOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 30
},
{
"type": "string",
"pattern": "^(?:[1-9]|[12][0-9]|30)$"
}
],
"default": "5"
},
"size": {
"type": "string",
"enum": [
"854x480",
"480x854",
"640x480",
"480x640",
"480x480",
"1120x480",
"480x1120",
"1280x720",
"720x1280",
"960x720",
"720x960",
"720x720",
"1680x720",
"720x1680",
"1920x1080",
"1080x1920",
"1440x1080",
"1080x1440",
"1080x1080",
"2520x1080",
"1080x2520",
"3840x2160",
"2160x3840",
"2160x2160",
"2880x2160",
"2160x2880",
"5040x2160",
"720x480",
"480x720",
"1080x720",
"720x1080",
"1620x1080",
"1080x1620"
],
"default": "1280x720",
"description": "映射到实际KIE分辨率/画幅;以模型已定价能力为准,不保证产物实测像素。"
},
"generate_audio": {
"type": "boolean"
},
"video_task_id": {
"type": "string",
"format": "uuid"
},
"character_orientation": {
"enum": [
"video",
"image"
]
},
"input_reference": {
"type": "string",
"format": "binary",
"description": "单张PNG<=10MiB,比例匹配size,按型号进一步校验。"
},
"input_reference_video": {
"type": "string",
"format": "binary",
"description": "Motion Control:单段MP4<=50MiB、3–30整秒、单视频轨道,>340px且比例0.4–2.5;秒数必须一致。"
}
},
"required": [
"model",
"prompt"
]
},
"encoding": {
"input_reference": {
"contentType": "image/png"
},
"input_reference_video": {
"contentType": "video/mp4"
}
}
}
Responses
200
创建标准异步视频对象,原意图不重复收费
{
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"object": {
"const": "video"
},
"model": {
"type": "string"
},
"status": {
"enum": [
"queued",
"in_progress",
"completed",
"failed",
"unknown"
]
},
"progress": {
"type": "integer",
"minimum": 0,
"maximum": 100,
"description": "未结算为0,成功结算为100;供应商没有进度时不编造百分比。"
},
"created_at": {
"type": "integer",
"minimum": 0
},
"completed_at": {
"type": "integer",
"minimum": 0
},
"seconds": {
"type": "string",
"pattern": "^(?:[1-9]|[12][0-9]|30)$"
},
"size": {
"type": "string",
"enum": [
"854x480",
"480x854",
"640x480",
"480x640",
"480x480",
"1120x480",
"480x1120",
"1280x720",
"720x1280",
"960x720",
"720x960",
"720x720",
"1680x720",
"720x1680",
"1920x1080",
"1080x1920",
"1440x1080",
"1080x1440",
"1080x1080",
"2520x1080",
"1080x2520",
"3840x2160",
"2160x3840",
"2160x2160",
"2880x2160",
"2160x2880",
"5040x2160",
"720x480",
"480x720",
"1080x720",
"720x1080",
"1620x1080",
"1080x1620"
]
},
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"message": {
"type": "string"
},
"code": {
"type": "string"
}
},
"required": [
"message",
"code"
]
},
"model_name": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "管理员配置的公开调用名称;默认沿用现有型号。C端使用该名称,内部身份仅管理员可见。"
}
},
"required": [
"id",
"object",
"model",
"status",
"progress",
"created_at",
"seconds",
"model_name"
]
}
}
},
"headers": {
"X-OneAster-Request-ID": {
"schema": {
"type": "string"
}
},
"X-OneAster-Reused": {
"schema": {
"type": "string",
"enum": [
"true",
"false"
]
}
}
}
}
default
标准OpenAI错误,无Core success/data外壳。
{
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"param": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"code": {
"type": "string"
}
},
"required": [
"message",
"type",
"param",
"code"
]
}
},
"required": [
"error"
]
}
}
},
"headers": {}
}