ChatArtAPI Docs

Video Generation

Submit an asynchronous task using native ChatArt parameters.

POST/v1/videos

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.

FieldTypeRequiredDescription
gpt_typestringRequiredNative ChatArt identifier returned by GET /v1/models.
promptstringRequiredVideo description; required for every video model, including Genjutsu.
image_urlstring[]OptionalReference media URLs. Defaults to an empty list for text-to-video.
durationnumberOptionalModel-supported duration in seconds.
qualitystringOptionalNative model quality. Submit a quality with a configured API quote.
ratiostringOptionalNative model aspect ratio; Genjutsu requires an empty ratio.
soundnumberOptionalNative sound setting, when supported.
video_idintegerOptional101 for text input, 102 for image input. Omit to infer it from the references.
function_modestringOptionalsingle_image, first_last_frames or omni_reference where the model supports it. First/last frames use an ordered image_url array.
video_url_liststring[] | stringOptionalGenjutsu only: exactly one MP4/MOV reference video.
image_url_liststring[] | stringOptionalGenjutsu 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.

JSON
{
  "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
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 — IMAGE TO VIDEO
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 — FIRST / LAST FRAME
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 — MULTIPLE REFERENCE IMAGES
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

JSON
{
  "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

GET/v1/tasks/{task_id}

Use the returned task_id to poll progress and retrieve result URLs. See Task Status for response fields and terminal states.

On this page