Skip to content
Kling AI logo

Kling v3 Image

Text-to-Image • Kling AI

View as MarkdownAgent setup

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 Licenselink ↗
More informationlink ↗
Pricing
  • Per image$0.027

Usage

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"
  }
}'
Simple Generation
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/klingai/kling-v3-image/simple-generation.png"
  }
}

Parameters

prompt
stringrequiredText prompt describing the image to generate
negative_prompt
stringNegative text prompt
image
stringReference image (Base64 encoding or URL) for image-to-image
resolution
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 images
image
stringURL to the generated image

API Schemas (Raw)

Input
Output

Was this helpful?