Kling video
Create Kling video tasks through AnyInt's OpenAI-style video route. Use the Transtreams native routes only when you need provider-native payload control.
Kling video generation is an asynchronous task flow. Create a task first, store the returned video ID, then poll the video status route until the task reaches a terminal state.
For new integrations, use the OpenAI-style video route. It accepts public AnyInt model IDs such as kling-3.0 and kling-v3-omni and adapts the request to the underlying Kling provider route.
Base URL
https://api.anyint.aiAuthentication
Authorization: Bearer <ANYINT_API_KEY>Recommended routes
| Route | Purpose |
|---|---|
POST /openai/v1/videos | Create a Kling video task |
GET /openai/v1/videos/{video_id} | Query task status |
GET /openai/v1/videos/{video_id}/content | Download generated video content after completion |
Request fields
| Field | Type | Required | Meaning | Example |
|---|---|---|---|---|
model | string | Yes | AnyInt video model ID available to your account. Use kling-3.0 for Standard/Pro Kling video or kling-v3-omni for Omni. | kling-3.0 |
prompt | string | Yes | Text instruction describing the generated video. | A cinematic paper airplane flying through a blue sky. |
duration | integer or string | Optional | Target video duration in seconds. Supported values depend on the selected model. | 5 |
aspect_ratio | string | Optional | Output aspect ratio when supported. | 16:9 |
mode | string | Optional | Edition selector when supported. Use std or pro. | std |
generate_audio | boolean | Optional | Whether to request audio when the selected route supports it. | false |
sound | string | Optional | Audio mode for Omni-compatible requests. | off |
image | string | Optional | Public HTTPS image URL used as the first-frame or image-to-video reference. | https://your-domain.com/source.png |
input_reference | string | Optional | Public HTTPS image URL or supported image input used as a reference. | https://your-domain.com/source.png |
frame_images | array | Optional | Structured frame references. Use role or frame_type to identify the frame role when needed. | [{"url":"https://...","role":"first_frame"}] |
input_references | array | Optional | Additional image, video, or audio references when the selected model supports them. | [{"url":"https://...","type":"video"}] |
Text-to-video example
curl -X POST "https://api.anyint.ai/openai/v1/videos" \
-H "Authorization: Bearer $ANYINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-3.0",
"prompt": "A cinematic paper airplane flying slowly through a blue sky, stable camera, soft daylight.",
"duration": "5",
"aspect_ratio": "16:9",
"mode": "std",
"generate_audio": false
}'Image-to-video example
Use a publicly reachable HTTPS image URL from your own storage.
curl -X POST "https://api.anyint.ai/openai/v1/videos" \
-H "Authorization: Bearer $ANYINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-3.0",
"prompt": "Animate the subject with a slow cinematic dolly-in while keeping the background consistent.",
"image": "https://your-domain.com/source-image.png",
"duration": "5",
"aspect_ratio": "16:9",
"mode": "pro",
"generate_audio": false
}'Omni reference example
Use kling-v3-omni when you need the Omni video model.
curl -X POST "https://api.anyint.ai/openai/v1/videos" \
-H "Authorization: Bearer $ANYINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3-omni",
"prompt": "Make the character in the reference image turn toward the camera in an animated film style.",
"input_reference": "https://your-domain.com/person.png",
"frame_images": [
{
"url": "https://your-domain.com/person.png",
"role": "first_frame"
}
],
"duration": "5",
"aspect_ratio": "16:9",
"sound": "off"
}'Create response
Store the returned id. Use it as {video_id} in later status and content requests.
| Field | Meaning |
|---|---|
id | Video task ID to store for polling |
object | Object type, usually video |
status | Initial task status, such as processing |
model | Model ID used for the task |
error | Error details when task creation fails |
Example response:
{
"id": "video_...",
"object": "video",
"status": "processing",
"model": "kling-3.0",
"error": null
}Query status
curl -X GET "https://api.anyint.ai/openai/v1/videos/$VIDEO_ID" \
-H "Authorization: Bearer $ANYINT_API_KEY"Query response fields
| Field | Meaning |
|---|---|
id | Video task ID |
status | Current task state. Treat completed as success and failed, cancelled, or canceled as terminal failure states. |
progress | Progress value when returned by the provider |
download_url | Content route for the generated video when the task has completed |
error | Failure details when the task fails |
Example completed response:
{
"id": "video_...",
"object": "video",
"status": "completed",
"progress": 100,
"model": "kling-3.0",
"download_url": "/v1/videos/video_.../content",
"error": null
}If download_url is relative, resolve it against the OpenAI-compatible API prefix:
curl -L "https://api.anyint.ai/openai$DOWNLOAD_URL" \
-H "Authorization: Bearer $ANYINT_API_KEY" \
--output kling-video.mp4Transtreams native routes
The provider-native Transtreams routes remain available when you need the native request shape:
| Route | Purpose |
|---|---|
POST /transtreams/kling/v1/videos/text2video | Create a native text-to-video task |
POST /transtreams/kling/v1/videos/image2video | Create a native image-to-video task |
GET /transtreams/kling/v1/videos/text2video/{task_id} | Query a native text-to-video task |
GET /transtreams/kling/v1/videos/image2video/{task_id} | Query a native image-to-video task |
POST /transtreams/kling/v1/videos/omni-video | Create a native Kling V3 Omni task |
GET /transtreams/kling/v1/videos/omni-video/{task_id} | Query a native Kling V3 Omni task |
Use native routes only when your integration already depends on Transtreams-native fields such as model_name, image_list, or video_list. New integrations should prefer /openai/v1/videos.
For native Standard/Pro requests, use model_name: "kling-v3" with mode: "std" or "pro". For native Omni requests, use model_name: "kling-v3-omni" and the /videos/omni-video route.
Common mistakes
- Sending Kling video requests to Chat Completions or Responses routes.
- Using
/transtreams/kling/...for a new integration when/openai/v1/videosis sufficient. - Sending
kling-v3-stdas nativemodel_nameinstead ofmodel_name: "kling-v3"plusmode: "std". - Sending
kling-v3-omnito a native Standard/Pro route instead of/transtreams/kling/v1/videos/omni-video. - Treating a
processingresponse as a completed video. Always poll until a terminal status. - Fetching a relative
download_urlwithout the/openaiprefix or without theAuthorizationheader.
Gemini Compatible API
AnyInt exposes Gemini-compatible routes under the /gemini/v1beta prefix. Treat these as provider-native routes and validate them in your environment before production use.
Media APIs
AnyInt publishes media-generation routes through OpenAI-style video routes, DashScope media routes, and provider-native media routes. These are task-based media APIs, not chat-completion endpoints.