API Documentation
AI generation APIs (video & LLM chat) authenticated with APIKey
APIKey Authentication
All generation endpoints (video generation and LLM chat) use APIKey for authentication; no prior login is required.
Include it in the request header:
Basic Information
http://localhost:8899
/Api/v1/VideoGen
/Api/v1/LLM
{"Success": true, "Message": "...", "Data": {...}}; LLM endpoints use the OpenAI-compatible format (see below)
HTTP Status Codes
| Status Code | Meaning |
|---|---|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 401 | Invalid APIKey / unauthenticated |
| 402 | Insufficient balance |
| 403 | Forbidden - invalid model or parameters |
| 429 | Too many requests (rate limited) |
| 500 | Internal server error |
Endpoint List
/Api/v1/VideoGen/gensd
Generate video (SD multimodal)
Pass multimodal inputs (text/image/video/audio) through a unified content array, and the SDK automatically distributes them to the corresponding fields. Suitable for scenarios requiring multiple reference materials at once.
Request Body (JSON)
{
"model": "SD",
"duration": 5,
"resolution": "720p",
"ratio": "16:9",
"content": [
{ "type": "text", "text": "A cat walking on the street" },
{ "type": "image_url", "role": "reference_image", "image_url": { "url": "https://..." } },
{ "type": "video_url", "role": "reference_video", "video_url": { "url": "https://..." } },
{ "type": "audio_url", "role": "reference_audio", "audio_url": { "url": "https://..." } },
{ "type": "image_url", "role": "first_frame", "image_url": { "url": "https://..." } }
]
}
Parameter Description
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name: SD |
| content | array | Yes | Multimodal content list (text / image_url / video_url / audio_url) |
| duration | int | Yes | Video duration (seconds) |
| resolution | string | Yes | 480p / 720p / 1080p |
| ratio | string | No | Aspect ratio, e.g. 16:9 |
content Sub-item Field Description
| Field | Type | Description |
|---|---|---|
| type | string | text / image_url / video_url / audio_url |
| text | string | Text content (used when type=text) |
| image_url | object | Image URL object {"url": "..."} (used when type=image_url) |
| video_url | object | Video URL object {"url": "..."} (used when type=video_url) |
| role | string | first_frame / reference_image / reference_video / reference_audio |
role Constraint Description
| role | Corresponding Field | Quantity Limit |
|---|---|---|
| text | text | 1 |
| reference_image | image_url | Up to 9 (Reference Image) |
| reference_video | video_url | Up to 1 (Reference Video) |
| reference_audio | audio_url | Up to 1 (Reference Audio) |
| first_frame | image_url | Up to 1 (First Frame Image) |
Successful Response
{
"id": "xxx"
}
Error Response (OpenAI format)
{
"error": {
"code": "invalid_parameters",
"message": "Incorrect parameters"
}
}
/Api/v1/VideoGen/gen
Generate video
Automatically routes to the SD / HH / YK / WAN service based on ModelName.
Request Body (JSON)
{
"modelName": "SD",
"prompt": "A cat walking on the street",
"duration": 5,
"resolution": "720p",
"imageUrl": "https://...",
"referenceVideoUrl": "https://...",
"referenceAudioUrl": "https://...",
"aspectRatio": "16:9",
"images": ["https://...", "https://..."]
}
Parameter Description
| Field | Type | Required | Description |
|---|---|---|---|
| modelName | string | Yes | Model name: SD / HH / YK / WAN (or TEST) |
| prompt | string | Yes | Prompt text |
| duration | int | Yes | Video duration (seconds) |
| resolution | string | Yes | 480p / 720p / 1080p |
| imageUrl | string | No | First frame / reference image URL |
| referenceVideoUrl | string | No | Reference video URL |
| referenceAudioUrl | string | No | Reference audio URL |
| aspectRatio | string | No | Aspect ratio, e.g. 16:9 |
| images | string[] | No | Reference image list (media URLs) |
Successful Response
{
"id": "xxx"
}
Error Response (OpenAI format)
{
"error": {
"code": "invalid_api_key",
"message": "API Key does not exist or has insufficient permissions"
}
}
HTTP Status Code Description
| Status Code | error.code | Description |
|---|---|---|
| 401 | invalid_api_key | API Key invalid or insufficient permissions |
| 402 | insufficient_balance | Insufficient account balance |
| 403 | invalid_model | Incorrect model |
| 403 | invalid_parameters | Incorrect parameters |
| 500 | internal_error | Internal server error |
/Api/v1/VideoGen/status
Query video task status
Request Body (JSON)
{
"id": "xxx"
}
Parameter Description
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID returned by the video generation task |
Successful Response (Completed)
{
"id": "xxx",
"model": "SD",
"status": "succeeded",
"created_at": "2025-01-01T00:00:00Z",
"expire_at": "2025-01-02T00:00:00Z",
"content": [
{
"type": "video",
"video_url": "https://...",
"duration": 5,
"resolution": "720p"
}
],
"usage": {
"credits": 10.0,
"token": 0
}
}
Successful Response (Processing)
{
"taskid": "xxx",
"model": "SD",
"status": "pending",
"created_at": "2025-01-01T00:00:00Z"
}
Successful Response (Failed)
{
"id": "xxx",
"model": "SD",
"status": "failed",
"created_at": "2025-01-01T00:00:00Z",
"error": {
"message": "Failure reason"
},
"usage": {
"credits": 0,
"token": 0
}
}
Status Description
| status Value | Description |
|---|---|
| pending | Processing |
| succeeded | Completed |
| failed | Failed |
/Api/v1/VideoGen/audit
Submit asset for review
Submit the asset for review. The full URL of the asset must be provided.
Request Body (JSON)
{
"url": "https://...",
"name": "Asset name",
"type": "Image"
}
Parameter Description
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Asset URL to be reviewed |
| name | string | Yes | Asset name |
| type | string | No | Image / Video / Audio |
Successful Response
{
"Success": true,
"Message": "Review submitted successfully",
"Data": {
"TaskId": "xxx",
"AssetId": "yyy"
}
}
/Api/v1/VideoGen/auditstatus
Query asset review status
Request Body (JSON)
{
"assetId": "yyy"
}
Parameter Description
| Field | Type | Required | Description |
|---|---|---|---|
| assetId | string | Yes | The AssetId returned by the review task |
Successful Response
{
"Success": true,
"Message": "Review status query successful",
"Data": {
"Status": 1,
"ServerStatus": "approved"
}
}
Status Description
| status Value | Description |
|---|---|
| 1 | Approved |
| 2 | Reviewing |
| 3 | Rejected |
/Api/v1/LLM/chat/completions
LLM Chat Completion
Chat completion for the 9 supported language models (DeepSeek / Qwen / GLM / Kimi). The request and response use the OpenAI-compatible format. Set stream=true to receive an SSE streaming response.
Supported Models
deepseek-v4-pro-0813
deepseek-v4-flash-0731
qwen3.8-max
qwen3.8-flash
qwen3.7-plus
qwen3.7-max
qwen3.7-flash
glm-5.2
kimi-k3
Request Body (JSON)
{
"model": "qwen3.8-max",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hello!" }
],
"stream": false,
"temperature": 0.7,
"top_p": 0.8,
"max_tokens": 1024
}
Parameter Description
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name (one of the supported models above) |
| messages | array | Yes | Conversation messages: {"role": "system"|"user"|"assistant", "content": "..."} |
| stream | bool | No | Default false; true returns an SSE streaming response |
| temperature | number | No | Sampling temperature, range [0, 2) |
| top_p | number | No | Nucleus sampling threshold (0, 1] |
| max_tokens | int | No | Maximum number of tokens to generate |
| max_completion_tokens | int | No | Maximum total output tokens (thinking + answer), recommended for thinking models |
| stop | string/array | No | Stop condition: a string or an array of strings / token ids |
| presence_penalty | number | No | Presence penalty, range [-2.0, 2.0] |
| frequency_penalty | number | No | Frequency penalty, range [-2.0, 2.0] |
| n | int | No | Number of answers to generate, 1~4 (qwen-plus only) |
| seed | int | No | Random seed |
| tools | array | No | Tools (function calling), cannot be used together with stream=true |
| stream_options | object | No | Stream options, e.g. {"include_usage": true}. Only valid when stream=true |
| enable_thinking | bool | No | Whether to enable deep thinking mode |
| thinking_budget | int | No | Thinking budget (thinking_budget, range 1~32768, larger = deeper thinking) |
Non-streaming response (stream=false)
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"created": 1716430652,
"model": "qwen3.8-max",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help you today?" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 10, "completion_tokens": 12, "total_tokens": 22 }
}
Streaming response (SSE, stream=true)
When stream=true, the server returns data:-prefixed JSON chunks as text/event-stream; the incremental text is in choices[0].delta.content (thinking text in delta.reasoning_content), ending with data: [DONE].
data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","created":1716430652,"model":"qwen3.8-max","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}
data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","created":1716430652,"model":"qwen3.8-max","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","created":1716430652,"model":"qwen3.8-max","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]}
data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","created":1716430652,"model":"qwen3.8-max","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]
HTTP Status Code Description
| Status Code | error.code | Description |
|---|---|---|
| 401 | invalid_api_key | API Key invalid or insufficient permissions |
| 403 | invalid_model | Unsupported model |
| 403 | invalid_parameters | Incorrect parameters |
| 429 | rate_limit_exceeded | Too many requests, please try again later |
| 500 | internal_error | Internal server error |
APIKey Management
APIKeys must be created and managed on the API Keys page after logging in.