mp4 or mov file (upload, or a direct file link); 3–20 s each and 20 s in total; reference video length is billed. The prompt refers to them as Video 1…
Two ways in, one API key and one balance: call the API from your own code, or let Claude Code or Codex call it for you through the APIKO MCP.
Option 1 · Call the API from your code
For: product backends, batch jobs, automation
1
Authenticate
Create an API key in the console, keep it in the APIKO_API_KEY environment variable and send Authorization: Bearer <key> with every request.
2
Submit a kling-4.0-flash task
Send the model ID and prompt to POST /v1/videos; it returns the task id right away. Other fields are in the parameter list above.
3
Get the result
Poll GET /v1/videos/{id}; when status is completed, take the video URL. Or pass callback_url and wait for the call. Links last 24 hours, so download what you keep.
Use the APIKO MCP to generate a 3-second 720p video of a paper boat drifting through a shallow stream with Kling 4.0 Flash. Wait for completion and return the video URL.
With reference video, billed seconds are output seconds plus the greater of output seconds and rounded-up total reference seconds.
How is Kling 4.0 Flash billed?
Without reference videos, you pay the published rate for each output second. With reference videos, round their combined duration up to the next whole second when needed. Billed seconds are the output duration plus the greater of the output duration and that rounded total. APIKO holds the cost of the output plus 20 seconds at submission and settles the charge when the video is ready.
Is it OpenAI-compatible?
Yes. Use the gateway base URL and your API key with the model-specific image/video endpoint and the additional fields shown above.
How do I get an API key?
Sign up, then create an API key in your console. One API key can call every model on the gateway.
Is there a free trial for the Kling 4.0 Flash API?
Eligible new accounts receive $0.20 in trial credit. A 3-second 720P Kling 4.0 Flash video costs about $0.334, so the credit alone cannot cover it. Top up from $5 to generate a video.
How do I receive the generated file?
Images are asynchronous: submit the request, poll GET /v1/tasks/<id>, then read data[0].url. Videos are asynchronous: poll GET /v1/videos/<id>, then download video_url. APIKO-signed links are kept for 24 hours.
What if a request fails?
You are not billed for failed or errored calls. Retry, and if it keeps failing, contact us via the live chat at the bottom right of the page.