AIPUBLISHED UPDATED 7 MIN READ

How I made Claude generate images and video

Claude cannot generate images or video by itself, but a custom skill can hand it an API that does. I wired kie.ai, an aggregator that resells GPT Image 2, Nano Banana, Seedream, Seedance, Kling and Veo through one API key on prepaid credits, into a skill called /kie-media, so the same chat that writes the prompt now runs it, polls the result and downloads the file. In a live run for this post, one 2K image on Nano Banana 2 cost 8 credits, or $0.04, and finished in 26 seconds; a 5-second Seedance 2.0 Mini clip cost 41 credits, or $0.21, and took 114 seconds. The whole setup is a $25 credit pack, one skill folder of 647 lines, and four domains on the sandbox allowlist.

TL;DR

  • Claude was already writing every image prompt; the only missing piece was a way to call a generator. A skill with a kie.ai key closes that gap inside one chat.
  • Real numbers from this post's run: a 2K image for 8 credits ($0.04) in 26 seconds, a 5-second 720p clip for 41 credits ($0.21) in 114 seconds. $25 bought 5,000 credits, no subscription.
  • The one failure was a 403 with `x-deny-reason: host_not_allowed`: kie serves results from tempfile.aiquickdraw.com, so that host has to be on the sandbox allowlist too.

The round trip was the problem, not the model

Most of what I ask Claude for in a working day is visual. A cover for a post, an illustration for a deck, a photoreal prop for a landing page, a five-second loop for a hero section. Claude is good at the thinking part of that, and until recently completely useless at the last step, because it cannot generate a single pixel on its own.

So the workflow looked like this. Talk the idea through in a chat. Have Claude turn it into a structured prompt, one idea per clause, the way I described in I Tried AI for Video. Here's What I Got. Open Midjourney, Higgsfield or Gemini in another tab. Paste. Wait. Download. Drag the result back into the chat and ask what to fix. Get a corrected prompt. Switch tabs again. How many laps that takes depends entirely on how complex the picture is: a simple prop lands in one or two, a scene with three things in it can eat an evening.

None of those laps were creative work. They were clipboard work.

Claude was already writing every prompt. It just couldn't press generate. Once I saw it that way, the fix was obvious: don't look for a smarter model, give the model I already use a way to call one.

What is kie.ai, and why one key instead of five accounts?

kie.ai is an API reseller. One endpoint shape, one API key, and behind it third-party models it resells on prepaid credits: GPT Image 2 and 1.5, Google's Nano Banana 2 and Pro, Seedream 5, Flux-2 and Grok Imagine for images; Seedance 2.0, Kling 3.0, Veo 3.1, Wan and Hailuo for video; plus utilities like Recraft background removal and Topaz upscaling. Chat models are on the list too, GPT 6 Astra and Claude Fable 5 among them, but that is not what I came for.

Every job is the same three calls, whatever the model: POST createTask with a model string and an input object, GET recordInfo until the state flips from waiting to success, then download whatever is in resultUrls. Learn it once, use it for a dozen models.

The pricing is the part that made me sign up. I paid $25 and got 5,000 credits, at $0.005 a credit, with no subscription and no expiry. An image on Nano Banana 2 runs me about 8 credits. Compare that with what I wrote about Higgsfield last month: a lovely tool priced for someone who opens it every morning, which I am not. Prepaid credits fit a person who needs eight visuals one week and none the next.

The honest counterweight: you are trusting a middleman with your key and your files. Reviews mention a 2.5-star Trustpilot score and complaints about credits disappearing, and the result URLs expire in about 24 hours, so the download is not optional. I keep the top-up small and the files local.

How is the /kie-media skill put together?

A skill in Claude is a folder with a SKILL.md on top, zipped and uploaded under Customize > Skills; the instructions load when a task matches them, and any script in the folder runs in Claude's code sandbox. I covered the structure and the registration traps in How to properly configure your AI skills, so here is only what this one contains.

File

Lines

What it does

SKILL.md

126

When to generate, when not to, model routing, QA checklist

references/models.md

55

Exact model strings and input keys, verified against the kie docs

references/prompting.md

61

The photographer's style block and a prompt library

scripts/kie.py

312

createTask, poll recordInfo, download, cutout, upscale, batch

assets/jobs.template.json

93

A batch of assets for an App Store screenshot set

647 lines in total, and the only part Claude reads on every run is the top of SKILL.md. The rest loads when needed, so the reference tables cost nothing until a model string is in question.

The key never lives in the folder. The script reads KIE_API_KEY from the environment, or a path in KIE_API_KEY_FILE, and stops with a clear message if neither is set. Step zero of every session is python3 scripts/kie.py doctor, which checks the key, the requests package and that the two kie hosts are reachable from the sandbox:

✓ API key present
✓ requests importable
✓ reachable https://api.kie.ai
✓ reachable https://kieai.redpandaai.co
OK

That last check exists because the sandbox has a network allowlist, and both api.kie.ai and kieai.redpandaai.co had to be added to it before anything worked. Building the skill itself went without a single error. The one thing I forgot on the first run was the key. The doctor told me, I added it, done.

Which model does Claude pick, and how does it prompt?

The skill decides the model before I do, from a routing table in SKILL.md:

Need

Model

Why

Photoreal object from a reference photo

gpt-image-2-image-to-image

Best instruction following, accurate printed text, up to 16 inputs

Cheap drafts to explore pose and angle

nano-banana-2

Fast, about 8 credits, 4K capable

Transparent cutout

recraft/remove-background

Always a separate step; asking a generator for transparency is a coin flip

Bigger than 2K

topaz/image-upscale

Run on the cutout, factor 2

Video

Kling 3.0, Veo 3.1 or Seedance 2.0

Cinematic, reference with audio, or fast product demos

Two rules in that table cost me the most before I wrote them down. Never ask a generator for a screen, a face, a logo or a QR code. Generated UI is the number-one tell in a mockup, so the prompt asks for the phone screen filled with flat #00FF00 and the real screenshot gets dropped in later. And never ask for a transparent background: generate on pure white, cut out with Recraft.

The prompting is written for a photographer, not a poet. One key light from the top-left, 45 degrees up, fill from the right. No cast shadows, they are added once in layout so a set of twelve assets reads as one shoot. Camera 15-20 degrees above, 50 mm look. No text unless it is spelled out verbatim. Adjectives that don't change pixels get cut. The style block that says all this is prepended to every prompt with --style-block, and once the first asset is approved, its URL goes on every later job as --anchor, with an instruction to match its light and finish.

The batch template in the skill is the asset list for an eSIM app's App Store screenshots: a nano-SIM, an ejector pin, a receipt with verbatim text, a right hand holding a phone with a green screen. Three to four variants of each, because selection is where quality comes from, and a variant costs cents.

What happened in a live run for this post?

I asked Claude to make a cover candidate for this post through the skill, no reference image, so I could publish the real numbers instead of a screenshot of someone else's. Here is the prompt it wrote, in full, because a prompt you can paste is worth more than a description of one:

Photorealistic still life, editorial product photography. A dark matte charcoal desk surface seen from slightly above at about 20 degrees, 50 mm lens look, no wide-angle distortion. In the lower-left third: a slim matte-black access keycard the size of a credit card with a small gold contact chip, lying at a 15-degree angle, nothing printed on it. Along the right edge: the front slot of a compact black photo printer, with five freshly printed glossy photographs fanning out of it onto the desk, the top one still slightly curled; the photographs show soft abstract colour fields and simple landscape shapes, no people, no faces, no text. The upper-left two thirds of the frame is clean empty desk surface, evenly and softly lit, kept free for a text overlay. One soft key light from the top-left about 45 degrees above, gentle fill from the right, soft shadows falling down-right. Cool, slightly desaturated palette with a warm highlight on the gold chip and the glossy prints. Sharp, high detail, real materials with micro-texture. No text, no logos, no screens, no hands, no watermark. Full-bleed background image, not on a white background.

Then the command:

python3 scripts/kie.py image --model nano-banana-2 --prompt "…" --aspect 16:9 --res 2K --variants 3 --out kie-demo/cover

Credits before: 4,323.18. Task aaa4ae6b… answered waiting five times, then success. One 2K PNG, 2752×1536, 6.5 MB, in 25.7 seconds of server time, for exactly 8 credits. Credits after: 4,315.18.

The raw result, untouched: nano-banana-2, 16:9, 2K, 8 credits, 25.7 seconds.

The prompt asked for five prints. The model gave me four. That is the kind of miss you only catch by looking, and the reason the skill defaults to three variants instead of one.

And then the script crashed.

requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://tempfile.aiquickdraw.com/workers/images/image_978f…png

The generation was fine. The download was not. kie stores results on tempfile.aiquickdraw.com, a third host that was never on the sandbox allowlist, and the proxy said so in a header: x-deny-reason: host_not_allowed. I tried the obvious workaround, re-hosting the file through kie's own upload endpoint, and got a URL on tempfile.redpandaai.co. Also blocked. The doctor check passes because it only tests the two hosts I knew about. The fix is two more lines in the allowlist, and the doctor now needs a third check.

The clip went the same way, minus the crash, because I called the skill's functions from a wrapper that skips the download. Same still as the first frame, Seedance 2.0 Mini, 5 seconds, 720p, no audio. The prompt follows the skill's order, subject then action then camera then light then duration:

The same still life: a matte-black keycard lying on a dark desk and glossy photographs fanning out of a compact black photo printer at the right edge. Action: one more glossy photograph slowly slides out of the printer slot and settles onto the pile with a soft curl; the keycard stays still. Camera: slow, steady push-in toward the printer slot, no handheld shake, no cuts. Light: one soft key light from the top-left, unchanged. 5 seconds. No text, no logos, no people, no hands, realistic motion, no slow-motion effect.
Seedance 2.0 Mini, first frame from the still above, 41 credits, 113.6 seconds.

Image

Clip

Model

nano-banana-2

bytedance/seedance-2-mini

Output

16:9, 2K PNG

16:9, 720p, 5 s, MP4

Server time

25.7 s

113.6 s

Wall time with polling

41 s

121 s

Credits

8 ($0.04)

41 ($0.21)

Balance after both: 4,274.18. The whole demo cost 49 credits, or about 25 cents, and the only lap I ran was the one to the network settings.

What does it actually cost?

The money is the easy part. 677 credits used before today's run; if every one of them was an image, that is about 84 pictures for $3.39. The costs that matter are elsewhere.

What it buys

What it costs

Prompt, generate, review and correct in one chat

You still pick from variants; the model does not know which one is right

One key for a dozen models, prepaid, no subscription

A middleman between you and the model, with a mixed reputation

A photographic house style applied to every asset automatically

Input keys differ per model; a wrong one returns 422 and sends you to the docs

Results in 26 seconds for an image, two minutes for a clip

URLs expire in 24 hours; miss the download and you pay again

Runs inside Claude's sandbox, nothing installed locally

Four domains on the allowlist, and a 403 when you forget one

The gap Claude cannot close for you is taste. It will write a better prompt than most people, pick a sane model, light the scene consistently and hand you three variants. It will not tell you that variant two is the one, or that the whole idea is wrong. Same as when I described the missing 2.5 points on the video loops last month: the tool got faster, the art direction is still mine to learn.

The lap that's left

The loop I removed ran between two browser tabs. The loop that remains runs between me and the picture, and that one I want to keep: it's where the decisions live.

Next on the list: pass the approved still of one asset as the anchor for a whole set and see whether twelve generations really read as one shoot, and hand the clip a last frame as well as a first, so a five-second loop closes on itself instead of drifting. Both are one flag away in the skill. Neither is a lap between tabs.

Claude presses generate now. Deciding what deserves it is still the job.

The prompt was never the bottleneck. The paste was.

Ogtay Iskandarov

Designer and full-stack developer running klauzzdcode, a one-person studio in Baku. Freelance since 2023, I ship products from Figma to deploy and write down what survives contact with production.

STORY →

FAQ

Can Claude generate images or video on its own?

No, Claude has no built-in image or video generation. What it can do is call an external generator from a custom skill: a script in the skill sends the prompt to an API such as kie.ai, polls for the result and downloads the file, all inside the same chat.

How much does an image cost through kie.ai?

About 8 credits, or $0.04, for a 2K image on Nano Banana 2, at kie's rate of $0.005 per credit. A 5-second 720p clip on Seedance 2.0 Mini cost 41 credits, or $0.21, in my run; heavier models like Veo 3.1 and Kling 3.0 cost more per clip.

Does this work in claude.ai or only in Claude Code?

It works in claude.ai: custom skills upload as a zip under Customize > Skills on plans with code execution enabled, and the script runs in Claude's sandbox. The sandbox has a network allowlist, so api.kie.ai, kieai.redpandaai.co and the tempfile hosts that serve results all need to be on it.

Why does the kie.ai download fail with 403 host_not_allowed?

Because kie serves finished files from tempfile.aiquickdraw.com, not from api.kie.ai, and Claude's sandbox blocks any host that is not on its allowlist. Add tempfile.aiquickdraw.com and tempfile.redpandaai.co to the allowed domains; the task itself succeeded and the credits are already spent, so re-download from the task record within 24 hours.

Is kie.ai reliable enough for client work?

For my volume, yes, with two habits: small top-ups and immediate downloads. It is a reseller with a mixed reputation, a 2.5-star Trustpilot score and complaints about vanishing credits in reviews, and result URLs expire in about 24 hours, so the files live on my disk, not on theirs.