Open source · MIT · 0 runtime dependencies

Generatemedia.Keepyourkeys.

Your AI agent creates images and video on KIE.ai — without ever seeing the API key, and never spending more than you allow.

$ npm i -g @uxdata-co/kie
Use it in chat with AI
kie help
            ╭─●─╮           
           ╱     ╲          
          ╱  ╱╲   ╲         
         ╱  ╱  ╲ ╲ ╲        
        ╱  ╱────╲ ╲ ╲       
       ╱  ╱      ╲   ╲      
  ●───╯  ╱        ╲ ╲ ╰───● 

kie v0.5.0 · media generation for AI agents
images · video · zero deps · spend-guarded

$ kie credits
╭─ ▲ kie  credits ───────────────────────────────╮
  balance          980 credits  ≈ US$4.90       
  today            16 / 200  ███████████ 8%    
  remaining today  184 credits                  
╰────────────────────────────────────────────────╯

$ kie image nano-banana-2 \
    --prompt "isometric coffee shop" --aspect 16:9
 nano-banana-2  generating 40%  task_c0ffee12 14s
╭─ ▲ kie  generation complete ───────────────────╮
  state    success                              
  credits  8                                    
  files    kie-media/nano-banana-2-c0ffee12.png 
╰────────────────────────────────────────────────╯

Why kie

Your key is money.

Media APIs are the most expensive credentials to leak. Most wrappers read the key from an env var, pull in hundreds of packages and ship a default webhook.

01

Key in the keychain

macOS Keychain, or a 0600 file. Env vars need an explicit opt-in. Every byte of output goes through a redactor.

02

Hard spend cap

Per-task cap, daily budget and balance check — all before the request leaves your machine.

03

No third parties

Talks only to KIE's own hosts. No callbacks, no telemetry, no proxies.

04

Agent-native

JSON on stdout, exit codes you can branch on, and always file paths — never URLs that expire.

Install

Two minutes.

  1. 01

    Install

    Node ≥ 20. Published with npm provenance.

    npm i -g @uxdata-co/kie
  2. 02

    Store the key

    Input is hidden. It never appears in output again.

    kie key set
  3. 03

    Install the skill

    Claude Code, Codex, Cursor and Gemini CLI.

    kie skill install

Tutorials

Just ask.

Your coding agent makes the media, you keep the key.

  1. 1

    New session — skills load from ~/.claude/skills/.

  2. 2

    Ask in plain language, or invoke /kie-media.

youGenerate a 16:9 hero image of an isometric coffee shop with warm light, for the landing page.
Claude Code
$ kie credits --json$ kie image nano-banana-2 --prompt "isometric coffee shop, warm light" --aspect 16:9 --out ./assets --name hero-coffee --json
Done — 8 credits. Saved to assets/hero-coffee.png (1920×1080). Want a night version?

What the agent won't do

  • Jump to video — images first, then video with --max-credits.
  • Raise its own cap after a block (exit 3). It reports the reason.
  • Ask for, print or set the API key.
  • Hand you a KIE URL — you get a file path.

kie config set dailyBudget 300

Spend guard

Blocked means unsent.

Three independent checks run before any request leaves the machine. If one fails, you get exit code 3 and nothing was sent.

01

Per-task cap

Models without a verified price require an explicit --max-credits — the agent has to say out loud what it accepts to spend.

02

Daily budget

A local ledger records every task and writes back the real credits spent. Pending tasks count at their cap.

03

Balance

If the estimate exceeds what's left on the account, the request never leaves.

exit 3
$ kie video kling-3.0 --prompt "drone shot"
✖ Spend guard blocked the request: this model
  has no known credit estimate. Re-run with
  --max-credits <n> to state the most you
  accept to spend on this task.
Today: 16 credits used, 184 remaining.
$ echo $?
3

Documentation

Every command, one page.

Commands and flags, the model catalog, spend guard and exit codes, configuration, the agent skill and security notes.

Read the documentation →

FAQ

Does it work on Linux or Windows?

Yes. Without a Keychain the key is stored in ~/.config/kie/key with 0600 permissions. Everything else is identical.

How is the npm package built?

Every release is published by GitHub Actions from a git tag, with npm provenance: the tarball is cryptographically linked to the commit that produced it. Zero runtime dependencies, so what you audit is what runs.

What if a model isn't in the catalog?

kie run <model-id> --input '{…}' --max-credits N sends any KIE Market model. Check the schema on docs.kie.ai first, or use --dry-run.

Can I use it without an agent?

Of course. In a terminal it renders tables, panels and a live spinner; pipe it and you get JSON.

Cheap,safeimageAI.

MIT licensed. Read the source before you trust it with a key — that's the point.

View on GitHub →