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:
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
Reference
CLI Commands
Complete command reference for PiAPI CLI
piapi run <model> key=value...Run any model with key=value inputs
piapi run flux-dev prompt="a corgi" aspect_ratio=16:9Generate image
piapi run gpt-4o prompt="hello" --streamChat with streaming
piapi run sora2-pro prompt="waves" --asyncGenerate video (async)
piapi run remove-bg image=@./photo.png --downloadUpload & download
piapi task <subcommand>Manage async tasks
piapi task listList all tasks
piapi task get <id>Get task status
piapi task cancel <id>Cancel a task
piapi model <subcommand>Browse available models
piapi model listList all models
piapi model list --type videoFilter by type
piapi model schema flux-devShow model schema
piapi auth <subcommand>Manage authentication
piapi auth login --api-key sk-xxxLogin with API key
piapi auth statusCheck auth status
piapi auth logoutLogout
piapi quotaCheck account quota and credits
piapi quotaShow remaining credits
piapi config <subcommand>Manage configuration
piapi config showShow current config
piapi config set --key apiKey --value sk-xxxSet 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