POST
https://octopusx.ai
/
v1
/
videos
Kling Video Generation
curl --request POST \
  --url https://octopusx.ai/v1/videos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "seconds": "<string>",
  "size": "<string>",
  "image": "<string>",
  "metadata": {},
  "metadata.output_config": {},
  "metadata.scene_type": "<string>",
  "metadata.motion_level": "<string>",
  "metadata.offpeak": true,
  "metadata.last_frame_url": "<string>",
  "metadata.video_url": "<string>",
  "metadata.file_infos": "<string>",
  "metadata.ext_info": "<string>"
}
'
{
  "id": "video_123",
  "task_id": "video_123",
  "object": "video",
  "model": "kling-3.0-omni-720p-ref-audio",
  "status": "queued",
  "progress": 0,
  "created_at": 1712697600
}

Kling Video Generation

Kling uses POST /v1/videos to submit tasks, with JSON submission as the primary method.
  • The route entry is POST /v1/videos.
  • JSON submission is currently used.
  • Supports multiple scenarios, including text-to-video, image-to-video, and first-and-last-frame video generation.
  • Extended parameters, including output configuration and scenario type, are passed through the metadata field.
  • After a successful submission, the task id and status are returned, and the result is later polled via Task Status Query.

Supported Models

  • Kling-3.0-Omni: Kling 3.0 all-in-one version
  • Kling-2.6: Kling 2.6 version
  • Kling-2.5: Kling 2.5 version

Method and Path

POST /v1/videos

Request Example

curl -X POST https://octopusx.ai/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Kling-3.0-Omni",
    "prompt": "Cyberpunk city night scene, the camera slowly pushes in",
    "seconds": "5",
    "metadata": {
      "output_config": {
        "resolution": "720P",
        "aspect_ratio": "16:9"
      }
    }
  }'

Scenario Examples

Text-to-Video

{
  "model": "Kling-3.0-Omni",
  "prompt": "Cyberpunk city night scene, the camera slowly pushes in",
  "seconds": "5",
  "metadata": {
    "output_config": {
      "resolution": "720P",
      "aspect_ratio": "16:9"
    }
  }
}

Image-to-Video

{
  "model": "Kling-3.0-Omni",
  "prompt": "Make the character walk forward and smile",
  "image": "https://example.com/character.png",
  "seconds": "5",
  "metadata": {
    "output_config": {
      "resolution": "1080P",
      "aspect_ratio": "9:16"
    }
  }
}

First-and-Last-Frame Video Generation

{
  "model": "Kling-3.0-Omni",
  "prompt": "In a silent system space, the character is illuminated by a blue panel",
  "seconds": "15",
  "size": "720x1280",
  "metadata": {
    "output_config": {
      "duration": 15,
      "resolution": "720P",
      "aspect_ratio": "9:16",
      "audio_generation": "Enabled"
    },
    "last_frame_url": "https://example.com/last-frame.png"
  }
}

Motion Control

{
  "model": "Kling-3.0-Omni",
  "prompt": "The character waves hello",
  "image": "https://example.com/character.png",
  "seconds": "5",
  "metadata": {
    "scene_type": "motion_control",
    "motion_level": "pro",
    "output_config": {
      "resolution": "1080P",
      "aspect_ratio": "16:9"
    }
  }
}

Response Example

Note: The model field in the response may include a billing-spec suffix (such as 720p-ref-audio), which differs from the model name passed in the request.
{
  "id": "video_123",
  "task_id": "video_123",
  "object": "video",
  "model": "kling-3.0-omni-720p-ref-audio",
  "status": "queued",
  "progress": 0,
  "created_at": 1712697600
}

Authentication

Authorization: Bearer YOUR_API_KEY

Body

model
string
required
Model name. For example, Kling-3.0-Omni, Kling-2.6, Kling-2.5.
prompt
string
required
Prompt. The text description for video generation, supporting both Chinese and English.
seconds
string
Video duration. For example, 5, 10, 15.
size
string
Video size. Fast size input, for example 720x1280.
image
string
Reference image. Reference image URL.
metadata
object
Metadata. A container for extended parameters. It is recommended to place all upstream native parameters in metadata.
metadata.output_config
object
Output configuration. It is recommended to place all native parameters in output_config.
  • duration: duration (seconds)
  • resolution: resolution (720P, 1080P)
  • aspect_ratio: aspect ratio (16:9, 9:16, 1:1)
  • audio_generation: audio generation (Enabled, Disabled)
metadata.scene_type
string
Scene type. Examples: motion_control (motion control), avatar_i2v (digital human generation), lip_sync (lip sync), template_effect (template effects).
metadata.motion_level
string
Motion level. Examples: std (standard), pro (professional, used for motion control billing tiers).
metadata.offpeak
boolean
Whether off-peak billing is used. true: generate video off-peak; false: generate video immediately.
metadata.last_frame_url
string
Last frame in first-and-last-frame generation. Specify the tail-frame image URL when generating a first-and-last-frame video.
metadata.video_url
string
Reference video URL.
metadata.file_infos
string
File information. Native FileInfos passthrough (advanced usage).
metadata.ext_info
string
Extended information. Native ExtInfo string passthrough (advanced usage).

Response

id
string
Task ID.
task_id
string
Task ID (same as id).
object
string
Fixed to video.
model
string
Model name.
status
string
Task status. Common values include queued, processing, completed, failed, cancelled.
progress
integer
Progress percentage (0-100).
created_at
integer
Creation time (Unix timestamp).