Makernice
← All posts
A ceramic teapot and cup on a sunlit kitchen counter next to an open laptop whose screen shows a code editor with a side chat panelGuides

How to Use Kling 4.0 in Claude Code and Cursor?

Makernice Team · ·

Prices as of November 12, 2026 (price list v15).

Key takeaways

  • Kling 4.0 runs in Cursor and Claude Code through the Makernice MCP server, which gives the agent estimate_cost, generate and check_job.
  • Kling 4.0 offers text-to-video, image-to-video, first and last frame, and reference-to-video with up to 10 reference images, at 720p or 1080p.
  • A Kling 4.0 clip can run from 3 to 30 seconds and is billed per output second; every clip carries an audio track.
  • Input images for Kling 4.0 must be public https links to JPEG or PNG files; a local path from your project won't work over MCP.
Ask an AI assistant about this pageAsk ChatGPTAsk ClaudeAsk Perplexity

Kling 4.0, Kuaishou's video model, works from Cursor and Claude Code through the Makernice MCP server. Your agent writes the request, quotes it with estimate_cost and starts it with generate only after you approve the amount. The default clip, 5 seconds at 720p, is $0.84 at price list v15 (November 12, 2026).

How do I connect Kling 4.0 to Cursor and Claude Code?

Kling 4.0 needs the Makernice MCP server added once in each editor, with a browser sign-in instead of an API key. For Cursor, the Cursor setup page offers a one-click install and the matching block for ~/.cursor/mcp.json. Once the entry is in place, open Cursor's MCP settings and use the sign-in next to makernice; a browser tab asks you to approve the connection.

For Claude Code, the Claude Code setup page gives the claude mcp add --transport http --scope user makernice command complete with the server address. Run it, launch Claude Code, type /mcp and pick makernice to sign in.

Each connection gets its own spending rules: a per-job cap and, if you set one, a daily cap. Asking the agent for get_balance shows both, plus your balance and today's spend.

How do I generate Kling 4.0 videos inside Claude or ChatGPT?

Kling 4.0 videos are made inside Claude or ChatGPT by adding Makernice as a connector, then asking for the clip in a normal chat. The tool calls match the editor flow: an estimate_cost quote that informs you but locks nothing, a generate call capped by max_cost_usd, then check_job until the clip is ready.

  • In Claude, open Customize, then Connectors, and choose Add custom connector; paste the MCP URL and connect with your Makernice login. Team and Enterprise workspaces need an owner to add it first. Full steps: Claude connect page.
  • In ChatGPT on the web, open Plugins and add a custom MCP server with OAuth, pasting the ChatGPT-specific address; your plan or workspace must allow this. Mention Makernice with @ in a new chat to use it. Full steps: ChatGPT connect page.

How do I use up to 10 reference images with Kling 4.0?

Kling 4.0 uses reference images in reference-to-video mode: the agent sets mode r2v, puts 1 to 10 public https links in reference_images, describes the new scene in the prompt and picks an aspect_ratio from 16:9, 9:16, 1:1, 21:9. Makernice API requests take reference images only; reference videos and Motion Control are not supported. The exchange below keeps one teapot consistent from three catalog photos.

You: Here are three catalog photos of our teapot and cup (links below). Make a 5-second square clip of tea being poured on a sunny counter, same teapot. Price it first.

Cursor turns that into a reference-to-video request and asks for a quote:

{
  "name": "estimate_cost",
  "arguments": {
    "input": {
      "model": "kling-4.0",
      "mode": "r2v",
      "prompt": "The ceramic teapot from the references sits on a sunlit kitchen counter; a hand pours tea into the matching cup, steam curling up, gentle orbit around the set",
      "reference_images": [
        "https://example.com/catalog/teapot-front.jpg",
        "https://example.com/catalog/teapot-side.jpg",
        "https://example.com/catalog/teacup.jpg"
      ],
      "duration": 5,
      "resolution": "720p",
      "aspect_ratio": "1:1"
    }
  }
}

Cursor: Kling 4.0 would charge $0.84 for this (720p, 5 seconds, 1:1, price list v15). The estimate doesn't hold the price or start anything. Want me to run it?

You: Yes, run it.

Cursor sends the identical input to generate with the approved amount as max_cost_usd:

{
  "name": "generate",
  "arguments": {
    "input": {
      "model": "kling-4.0",
      "mode": "r2v",
      "prompt": "The ceramic teapot from the references sits on a sunlit kitchen counter; a hand pours tea into the matching cup, steam curling up, gentle orbit around the set",
      "reference_images": [
        "https://example.com/catalog/teapot-front.jpg",
        "https://example.com/catalog/teapot-side.jpg",
        "https://example.com/catalog/teacup.jpg"
      ],
      "duration": 5,
      "resolution": "720p",
      "aspect_ratio": "1:1"
    },
    "max_cost_usd": "0.84",
    "request_id": "teapot-pour-square-r2v-01"
  }
}

At that moment Makernice quotes the request again. If the new quote is within max_cost_usd and the connection's per-job cap, the job is created and charged exactly that quote; otherwise the call is refused and no job exists. The request_id makes retries safe: the same id with the same input returns the original job, while the same id with edited input is refused.

Cursor then calls check_job with wait_s (up to 55 seconds per call) until status is succeeded. The MP4 sits at outputs[0].url, a signed link valid for 24 hours, and console_url opens the run in your Makernice console. Calling check_job again later gives a new link. An account webhook also fires for MCP jobs if you want a push instead of polling.

How do I turn an image into a Kling 4.0 video?

Kling 4.0 turns an image into video with mode i2v and the picture in image_url as the first frame; adding last_image_url with mode flf makes the clip end on a second picture. Both modes take their shape from the frames, so the request has no aspect_ratio. The table maps each kind of request to its mode.

You wantModeFields the agent fills
A shot from a written descriptiont2vprompt, aspect_ratio
One still brought to lifei2vimage_url
A move from one frame to anotherflfimage_url and last_image_url
The same product or character across shotsr2vreference_images (1 to 10 links), aspect_ratio

Aspect ratio applies to text-to-video and reference-to-video, where Kling 4.0 accepts 16:9, 9:16, 1:1, 21:9. Image-to-video and first-and-last-frame clips take their shape from the frames you supply, so the agent leaves aspect_ratio out there. Each image must be a public https JPEG or PNG of up to 10 MB, at least 300 px on every side and with a width-to-height ratio between 0.4 and 2.5. More detail on each mode is on the Kling 4.0 model page.

How do I write a Kling 4.0 text-to-video request, and which settings matter?

A Kling 4.0 text-to-video request needs model, mode t2v and a prompt of up to 4,000 characters; the settings that matter are duration, resolution and aspect_ratio (16:9, 9:16, 1:1, 21:9). Write one shot per prompt: the subject, one main action, the camera and the sound. The Kling 4.0 prompt guide has worked examples for each mode.

Kling 4.0 takes any whole number of seconds from 3 to 30 (5 if you leave duration out) and either 720p or 1080p (720p by default). The per-second rate is $0.168 at 720p and $0.252 at 1080p, the same in every mode, so a clip's price is the rate times its length. Sound is always part of the output and there is no field to disable it.

Before a long or 1080p clip, have the agent quote that exact request. Here it prices a 12-second first-and-last-frame transition at 1080p:

{
  "name": "estimate_cost",
  "arguments": {
    "input": {
      "model": "kling-4.0",
      "mode": "flf",
      "prompt": "The empty counter fills with the full tea set as morning light sweeps across",
      "image_url": "https://example.com/frames/counter-empty.png",
      "last_image_url": "https://example.com/frames/counter-set.png",
      "duration": 12,
      "resolution": "1080p"
    }
  }
}

When Kling 4.0 requests come back refused

A refused MCP call returns readable text, and no job or charge results. Column one is the refusal's internal name in Makernice's server; column two is the opening of the text the agent sees.

RefusalWhat the tool returnsWhat to do
price_exceeds_max_cost"which exceeds max_cost_usd"You approved one length or resolution and the agent sent another; re-estimate and approve again
invalid_request"Invalid parameters"The text names the field, for example more than 10 reference images; fix it and quote again
request_id_conflict"This request_id was already used with different parameters."Give the edited request a new id; keep the old id only for retrying the unchanged one
concurrency_limit_reached"Too many jobs are running for this account right now."Wait for a running clip to finish before starting the next
per_job_limit_exceeded"which exceeds this connection's per-job limit"Drop to 720p or fewer seconds, or raise this connection's per-job limit

If the clip fails after it starts, for instance because moderation rejects an input image, check_job shows status failed and an error object, billing becomes released and the hold returns to your balance. The rules are on failed generations.

Frequently asked questions

How many reference images can Kling 4.0 take from Cursor?
Up to 10 in reference-to-video mode, passed as public https links in reference_images. Local files need to be uploaded somewhere public first.
Does Kling 4.0 have Pro and Standard tiers like Kling 3.0?
No. Kling 4.0 is a single model; you choose 720p or 1080p with the resolution field, and the per-second rate follows that choice.
Can Claude Code make a 30-second Kling 4.0 clip in one job?
Yes. Kling 4.0 accepts durations up to 30 seconds in a single request. It bills per output second, so ask for estimate_cost on the full length before approving.
Can I send WebP images to Kling 4.0?
No. Kling 4.0 input images need to be JPEG or PNG, and each side must meet the minimum size listed above.

Models in this post