Model ID
Use with the Workers AI binding, the AI Gateway REST API, or the Unified API.
Calling the provider directly? Use the provider's model name instead, including with provider-native endpoints or the provider's own SDK. For example, Anthropic's name for anthropic/claude-opus-4.8 is claude-opus-4-8.
- Third-party
Kling V3 is Kling AI's text-to-video model with audio generation support.
| Model Info | |
|---|---|
| Terms and License | link ↗ |
| More information | link ↗ |
| Pricing |
|
const response = await env.AI.run(
'klingai/kling-v3',
{
prompt:
'A golden retriever running through a field of sunflowers on a sunny day',
duration: 5,
aspect_ratio: '16:9',
sound: 'on',
},
{
gateway: { id: 'default' },
}
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "klingai/kling-v3",
"input": {
"aspect_ratio": "16:9",
"duration": 5,
"prompt": "A golden retriever running through a field of sunflowers on a sunny day",
"sound": "on"
}
}'{
"state": "Completed",
"result": {
"video": "https://examples.aig.cloudflare.com/klingai/kling-v3/simple-video.mp4"
}
}prompt
stringrequiredText prompt describing the video to generatenegative_prompt
stringNegative text promptimage_input
stringBase64-encoded reference image for i2vduration
integerrequireddefault: 5minimum: 3maximum: 15Video duration in secondsaspect_ratio
stringrequireddefault: 16:9enum: 16:9, 9:16, 1:1Video aspect ratiosound
stringrequireddefault: onenum: on, offWhether to generate sound with the videovideo
stringURL to the generated video