v0.1.1AI Agent Ready

PiAPI CLI

94 Multimodal AI Models from Your Terminal

Generate images, videos, audio, 3D assets, and chat with LLMs — all from a single command. Perfect for developers, AI agents, and automation workflows.

Install with npm:

$npm install -g piapi-cli
terminal
$ piapi run flux-dev prompt="a corgi astronaut"
✓ Creating task...
✓ Polling for result...
✓ Image generated successfully!
https://storage.piapi.ai/flux/corgi_astronaut.png
$ piapi run gpt-4o prompt="explain async/await" --stream
Async/await is syntactic sugar for Promises...
$ piapi model list --type video
sora2-pro     OpenAI Sora 2
kling-3       Kling 3.0
veo3-fast     Google Veo 3
hailuo        MiniMax Hailuo
... 36 more models

Everything you need

One CLI for all AI models

Generate images, videos, audio, 3D assets, and chat with LLMs using a unified command interface. No context switching between different APIs.

Image Generation
34 models including Flux, Nano Banana Pro, Seedream, plus tools like remove-bg, upscale, and faceswap.
flux-dev, nano-banana-pro, seedream-5-lite, qwen-image
Video Generation
40 models including Sora 2, Kling 3, Veo 3, Seedance 2, Hailuo, and Luma for professional video creation.
sora2-pro, kling-3, veo3-fast, wanx22, seedance-2
Audio & Music
10 models for TTS, sound effects, and music generation including F5-TTS, MMAudio, and Udio.
mmaudio, f5-tts, diffrhythm, udio-music, ace-step
3D Generation
Create 3D assets from text or images with Trellis models.
trellis (text→3D), trellis2 (image→3D)
LLM Chat
8 chat models with streaming support. GPT-4o, Claude Sonnet 4.6, GPT-5, and more.
gpt-4o, claude-sonnet-4.6, gpt-5, gpt-image-2
Auto Download
Use --download to automatically save generated files. Supports custom output directories.
--download --out-dir ./output
AI Agent Ready
Designed for Claude Code, Cursor, and other AI agents. Full agent skill specification included.
npx skills add PiAPI-1/piapi-cli
Local File Upload
Prefix inputs with @ to auto-upload local files before running the model.
image=@./photo.png, source=@./face.jpg

Quick Examples

# Generate an image
piapi run flux-dev prompt="sunset over mountains"
# Chat with streaming
piapi run gpt-4o prompt="explain quantum computing" --stream
# Generate video (async)
piapi run sora2-pro prompt="ocean waves" --async
# Upload and process
piapi run remove-bg image=@./photo.png --download

Reference

CLI Commands

Complete command reference for PiAPI CLI

piapi run
piapi run <model> key=value...

Run any model with key=value inputs

$piapi run flux-dev prompt="a corgi" aspect_ratio=16:9

Generate image

$piapi run gpt-4o prompt="hello" --stream

Chat with streaming

$piapi run sora2-pro prompt="waves" --async

Generate video (async)

$piapi run remove-bg image=@./photo.png --download

Upload & download

piapi task
piapi task <subcommand>

Manage async tasks

$piapi task list

List all tasks

$piapi task get <id>

Get task status

$piapi task cancel <id>

Cancel a task

piapi model
piapi model <subcommand>

Browse available models

$piapi model list

List all models

$piapi model list --type video

Filter by type

$piapi model schema flux-dev

Show model schema

piapi auth
piapi auth <subcommand>

Manage authentication

$piapi auth login --api-key sk-xxx

Login with API key

$piapi auth status

Check auth status

$piapi auth logout

Logout

piapi quota
piapi quota

Check account quota and credits

$piapi quota

Show remaining credits

piapi config
piapi config <subcommand>

Manage configuration

$piapi config show

Show current config

$piapi config set --key apiKey --value sk-xxx

Set config value

Global Flags

--help, -hShow help information
--version, -vShow version number
--api-key <key>API key (overrides env/config)
--output jsonJSON output on stdout
--asyncReturn task ID immediately (required for video/3D)
--streamStream LLM output as it arrives
--downloadAuto-download generated files
--out-dir <path>Download directory (default: cwd)
--dry-runPreview request without executing
--quietSuppress progress indicators
--webhook <url>Webhook URL for callbacks
--no-colorDisable ANSI colors

Frequently Asked Questions

Ready to get started?