Video Generation
Submit an asynchronous task using native ChatArt parameters.
Send Authorization: Bearer YOUR_API_KEY. Create a key in API Keys after signing in with a ChatArt account. New keys are stored encrypted and can be revealed in API Keys; authentication uses their hashes. Older hash-only keys cannot be revealed. Deleting a key revokes it immediately. Keys and tasks are isolated by account and application.
Request body
Use JSON, maximum 32KB. Unsupported fields and invalid model settings are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
| gpt_type | string | Required | Native ChatArt identifier returned by GET /v1/models. |
| prompt | string | Required | Video description; required for every video model, including Genjutsu. |
| image_url | string[] | Optional | Reference media URLs. Defaults to an empty list for text-to-video. |
| duration | number | Optional | Model-supported duration in seconds. |
| quality | string | Optional | Native model quality. Submit a quality with a configured API quote. |
| ratio | string | Optional | Native model aspect ratio; Genjutsu requires an empty ratio. |
| sound | number | Optional | Native sound setting, when supported. |
| video_id | integer | Optional | 101 for text input, 102 for image input. Omit to infer it from the references. |
| function_mode | string | Optional | single_image, first_last_frames or omni_reference where the model supports it. First/last frames use an ordered image_url array. |
| video_url_list | string[] | string | Optional | Genjutsu only: exactly one MP4/MOV reference video. |
| image_url_list | string[] | string | Optional | Genjutsu only: at most four reference images; ordinary models use image_url. |
Further native fields: img_url, original_model, mode, upload_info, product_images, person_image, reference_templates, product_type. Special scenes and modes without a configured quote are rejected before billing. Reference videos are supported only for Genjutsu; reference audio is unsupported. LitMedia fields model, last_image_url are not aliases.
Genjutsu reference video
Use gpt_type: genjutsu with a required prompt, exactly one MP4/MOV reference video (4–30 seconds, maximum 200 MB), and at most four images. Only this model accepts video_url_list, image_url_list and audio_url_list as arrays or comma-separated strings; audio must be empty. A single image_url string is prepended to the image list; native mixed image_url arrays also work. Defaults: quality 480p, sound 1, ratio empty. Quality supports 480p/720p/1080p. Mode is empty, matching LitMedia OpenAPI; its website character/motion selector is not exposed here. First/last-frame inputs are unsupported. Media metadata is fetched from public HTTP(S) URLs on default ports; redirects are rejected.
The server reads reference-video duration before reserving API credits. Client duration and upload_info cannot determine billing. Seconds are rounded down; rates are 25/50/120 API credits per second for 480p/720p/1080p. A 5.9-second 720p reference costs 250 credits. Metadata failures reject the request before billing.
{
"gpt_type": "genjutsu",
"prompt": "Replace the character using the reference image",
"video_url_list": [
"https://cdn.example.com/reference.mp4"
],
"image_url_list": [
"https://cdn.example.com/character.png"
],
"quality": "720p"
}curl -X POST "$CHATART_API_BASE_URL/v1/videos" \
-H "Authorization: Bearer $CHATART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gpt_type": "kling-4-0",
"prompt": "A quiet ocean at sunrise",
"duration": 5,
"quality": "720p",
"ratio": "16:9"
}'Reference input examples
curl -X POST "$CHATART_API_BASE_URL/v1/videos" \
-H "Authorization: Bearer $CHATART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gpt_type": "kling-4-0",
"prompt": "A quiet ocean at sunrise",
"duration": 5,
"quality": "720p",
"ratio": "16:9",
"image_url": [
"https://cdn.example.com/first.png"
]
}'curl -X POST "$CHATART_API_BASE_URL/v1/videos" \
-H "Authorization: Bearer $CHATART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gpt_type": "kling-4-0",
"prompt": "A quiet ocean at sunrise",
"duration": 5,
"quality": "720p",
"ratio": "16:9",
"image_url": [
"https://cdn.example.com/first.png",
"https://cdn.example.com/last.png"
],
"function_mode": "first_last_frames"
}'curl -X POST "$CHATART_API_BASE_URL/v1/videos" \
-H "Authorization: Bearer $CHATART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gpt_type": "kling-4-0",
"prompt": "A quiet ocean at sunrise",
"duration": 5,
"quality": "720p",
"ratio": "16:9",
"image_url": [
"https://cdn.example.com/character.png",
"https://cdn.example.com/scene.png"
],
"function_mode": "omni_reference"
}'Response
{
"code": 200,
"message": "success",
"data": {
"task_id": "task_example",
"status": "processing"
}
}Billing and retries
Each successful POST creates a new task and reserve API credits. Idempotency keys are not implemented. Do not automatically retry after a timeout or an uncertain submission. Check the portal Logs and ChatArt generation history first. Interrupted submissions appear as submission_unknown; they are never automatically submitted again.
Success responses use {code:200,message,data}. Creation returns HTTP 202; reads return 200. Errors use HTTP 400/401/402/403/404/409/422/500 and the same envelope with data:null. HTTP 402 indicates insufficient independent API credits. Native validation errors retain their business error codes. A model appearing in the web catalogue does not imply all parameter combinations are supported.
Video status
Use the returned task_id to poll progress and retrieve result URLs. See Task Status for response fields and terminal states.