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:

Authorization: Bearer <apiKey>
APIKeys are created and managed on the API Keys page (login required first).

Basic Information

Server http://localhost:8899
Base Path
/Api/v1/VideoGen /Api/v1/LLM
Rate Limit APIKey requests are limited to 3 per second; multiple consecutive invalid APIKeys will blacklist the IP
Response Format Video endpoints return {"Success": true, "Message": "...", "Data": {...}}; LLM endpoints use the OpenAI-compatible format (see below)

HTTP Status Codes

Status Code Meaning
200Request successful
400Invalid request parameters
401Invalid APIKey / unauthenticated
402Insufficient balance
403Forbidden - invalid model or parameters
429Too many requests (rate limited)
500Internal server error

Endpoint List

POST /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
modelstringYesModel name: SD
contentarrayYesMultimodal content list (text / image_url / video_url / audio_url)
durationintYesVideo duration (seconds)
resolutionstringYes480p / 720p / 1080p
ratiostringNoAspect ratio, e.g. 16:9

content Sub-item Field Description

Field Type Description
typestringtext / image_url / video_url / audio_url
textstringText content (used when type=text)
image_urlobjectImage URL object {"url": "..."} (used when type=image_url)
video_urlobjectVideo URL object {"url": "..."} (used when type=video_url)
rolestringfirst_frame / reference_image / reference_video / reference_audio

role Constraint Description

role Corresponding Field Quantity Limit
texttext1
reference_imageimage_urlUp to 9 (Reference Image)
reference_videovideo_urlUp to 1 (Reference Video)
reference_audioaudio_urlUp to 1 (Reference Audio)
first_frameimage_urlUp to 1 (First Frame Image)

Successful Response

{
  "id": "xxx"
}

Error Response (OpenAI format)

{
  "error": {
    "code": "invalid_parameters",
    "message": "Incorrect parameters"
  }
}
POST /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
modelNamestringYesModel name: SD / HH / YK / WAN (or TEST)
promptstringYesPrompt text
durationintYesVideo duration (seconds)
resolutionstringYes480p / 720p / 1080p
imageUrlstringNoFirst frame / reference image URL
referenceVideoUrlstringNoReference video URL
referenceAudioUrlstringNoReference audio URL
aspectRatiostringNoAspect ratio, e.g. 16:9
imagesstring[]NoReference 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
401invalid_api_keyAPI Key invalid or insufficient permissions
402insufficient_balanceInsufficient account balance
403invalid_modelIncorrect model
403invalid_parametersIncorrect parameters
500internal_errorInternal server error
POST /Api/v1/VideoGen/status Query video task status

Request Body (JSON)

{
  "id": "xxx"
}

Parameter Description

Field Type Required Description
idstringYesThe 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
pendingProcessing
succeededCompleted
failedFailed
POST /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
urlstringYesAsset URL to be reviewed
namestringYesAsset name
typestringNoImage / Video / Audio

Successful Response

{
  "Success": true,
  "Message": "Review submitted successfully",
  "Data": {
    "TaskId": "xxx",
    "AssetId": "yyy"
  }
}
POST /Api/v1/VideoGen/auditstatus Query asset review status

Request Body (JSON)

{
  "assetId": "yyy"
}

Parameter Description

Field Type Required Description
assetIdstringYesThe 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
1Approved
2Reviewing
3Rejected
POST /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
modelstringYesModel name (one of the supported models above)
messagesarrayYesConversation messages: {"role": "system"|"user"|"assistant", "content": "..."}
streamboolNoDefault false; true returns an SSE streaming response
temperaturenumberNoSampling temperature, range [0, 2)
top_pnumberNoNucleus sampling threshold (0, 1]
max_tokensintNoMaximum number of tokens to generate
max_completion_tokensintNoMaximum total output tokens (thinking + answer), recommended for thinking models
stopstring/arrayNoStop condition: a string or an array of strings / token ids
presence_penaltynumberNoPresence penalty, range [-2.0, 2.0]
frequency_penaltynumberNoFrequency penalty, range [-2.0, 2.0]
nintNoNumber of answers to generate, 1~4 (qwen-plus only)
seedintNoRandom seed
toolsarrayNoTools (function calling), cannot be used together with stream=true
stream_optionsobjectNoStream options, e.g. {"include_usage": true}. Only valid when stream=true
enable_thinkingboolNoWhether to enable deep thinking mode
thinking_budgetintNoThinking 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
401invalid_api_keyAPI Key invalid or insufficient permissions
403invalid_modelUnsupported model
403invalid_parametersIncorrect parameters
429rate_limit_exceededToo many requests, please try again later
500internal_errorInternal server error

APIKey Management

APIKeys must be created and managed on the API Keys page after logging in.