@flatkey-ai/cli
v0.1.5
Published
Flatkey media generation CLI for image, video, audio, credits, status, and models.
Downloads
811
Readme
Flatkey CLI
Creative generation from the terminal for media teams and AI agents. Generate images, videos, audio, and text through one Flatkey credit balance.
Website: flatkey.ai
npm install -g @flatkey-ai/cli
export FLATKEY_API_KEY=<your-flatkey-api-key>
flatkey image generate --prompt "editorial cover, neon city at dawn" -o cover.png
flatkey video generate --prompt "cinematic product launch clip" --model seedance2 -o launch.mp4
flatkey audio generate --prompt "你好,这是 Flatkey 的配音测试" -o speech.mp3
flatkey models --json
flatkey credits --jsonWhy Flatkey CLI
- One CLI for image, video, audio, and text generation.
- One
FLATKEY_API_KEY, one credit balance. - Agent-friendly JSON mode with clean stdout.
- Local output support with
--output/-o. - Cross-platform npm package for macOS, Linux, and Windows.
- Cool terminal progress animation for human runs; disabled in
--jsonmode.
Install
npm install -g @flatkey-ai/cliRun without installing:
npx @flatkey-ai/cli help --aiCheck local version:
flatkey --version
flatkey -vAuth
Use an environment variable:
export FLATKEY_API_KEY=<key>Or save it locally:
flatkey onboard --api-key <key>Get a key from flatkey.ai.
Commands
Generate Image
flatkey image generate \
--prompt "magazine cover, reflective typography, studio lighting" \
--model gpt-image-2 \
-o cover.pngGenerate Video
flatkey video generate \
--prompt "8 second cinematic product reveal, glossy black background" \
--model seedance2 \
-o launch.mp4Generate Audio
Text to speech:
flatkey audio generate \
--prompt "你好,这是 Flatkey 网关的语音测试。" \
--voice-id EXAVITQu4vr4xnSDxMaL \
--model eleven_multilingual_v2 \
--stability 0.5 \
--similarity-boost 0.75 \
--style 0 \
-o speech.mp3List voices:
flatkey audio voices --jsonSound effects:
flatkey audio sfx \
--prompt "glass shattering on the floor" \
--duration 3 \
-o sfx.mp3Music:
flatkey audio music \
--prompt "calm ambient piano, sad mood" \
--music-length-ms 10000 \
-o music.mp3Generate Text
flatkey text generate \
--prompt "write 5 sharp headlines for a creator tool launch" \
--model gpt-5.5 \
-o headlines.txtCredits, Status, Models
flatkey credits --json
flatkey status --json
flatkey models --json
flatkey models --type image --json
flatkey help --aiModels
Live model list:
flatkey models --jsonUseful current defaults:
| Type | Models |
| --- | --- |
| Image | gpt-image-2, nano-banana-pro-preview, Gemini image models |
| Video | seedance2, veo-3, veo-3-fast |
| Audio | eleven_multilingual_v2, ElevenLabs voices, sound effects, music |
| Text | gpt-5.5, Claude, Gemini, GLM, Grok models |
models reads from the Flatkey console model registry. Generation calls use the Flatkey router.
Agent Protocol
Use this when wiring Flatkey into Codex, Claude Code, Cursor, or other agents:
flatkey help --aiAgent rules:
- Prefer
FLATKEY_API_KEY. - Always pass
--jsonfor machine-readable output. - Use
--output/-owhen the generated file path matters. - Call
flatkey models --jsonbefore choosing a model. - Call
flatkey audio voices --jsonbefore choosing a TTSvoice_id. - Use
--dry-runto inspect request shape without spending credits.
Example dry run:
flatkey video generate \
--prompt "fashion campaign hero shot" \
--model seedance2 \
--dry-run \
--jsonRouting
- Generation router:
https://router.flatkey.ai - Model registry:
https://console.flatkey.ai/v1/available_models - Voice registry:
https://router.flatkey.ai/v1/voices
Override router only when developing or testing:
flatkey image generate --prompt "test" --base-url http://127.0.0.1:3000 --jsonRelease Channels
Primary release:
- npm package:
@flatkey-ai/cli
Planned wrappers:
- Homebrew formula.
- Debian
.debpackage for apt-based install. - Windows MSI package.
Development
git clone https://github.com/flatkey-ai/flatkey-cli.git
cd flatkey-cli
npm install
npm test
node bin/flatkey.js --versionLinks
- Website: flatkey.ai
- npm:
@flatkey-ai/cli - Issues: github.com/flatkey-ai/flatkey-cli/issues
