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 Image is Kling AI's text-to-image model for photorealistic image generation.
| Model Info | |
|---|---|
| Terms and License | link ↗ |
| More information | link ↗ |
| Pricing |
|
const response = await env.AI.run(
'klingai/kling-v3-image',
{
prompt:
'A photorealistic portrait of a fox in an autumn forest, golden hour lighting',
resolution: '1k',
aspect_ratio: '16:9',
},
{
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-image",
"input": {
"aspect_ratio": "16:9",
"prompt": "A photorealistic portrait of a fox in an autumn forest, golden hour lighting",
"resolution": "1k"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/klingai/kling-v3-image/simple-generation.png"
}
}prompt
stringrequiredText prompt describing the image to generatenegative_prompt
stringNegative text promptimage
stringReference image (Base64 encoding or URL) for image-to-imageresolution
stringrequireddefault: 1kenum: 1k, 2kImage generation resolution (1k: standard, 2k: high-res)aspect_ratio
stringrequireddefault: 16:9enum: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9Aspect ratio of generated imagesimage
stringURL to the generated image