Skip to main content

PiAPI CLI

94 Multimodal AI Models from Your Terminal

Generate AI images, videos, audio, 3D assets, and chat with LLMs from one command line interface. PiAPI CLI is built for developers, AI agents, and automation workflows.

Install with npm:

$ npm install -g piapi-cli

One AI CLI Tool for Multimodal Models

flux-devnano-banana-progpt-image-2qwen-imageseedream-5-litemidjourneyz-imageremove-bgupscalefaceswap

Run piapi model list to browse all models

$ piapi run flux-dev prompt="a corgi astronaut"

CLI Commands

$ 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

Full command reference & flags

Learn PiAPI CLI workflows

Frequently Asked Questions

What is PiAPI CLI?

PiAPI CLI is a command line interface for running PiAPI models from your terminal. It works as an AI CLI tool for image, video, audio, 3D, and chat generation workflows.

How do I authenticate?

Run piapi auth login --api-key sk-xxxxx with your PiAPI API key. You can get your API key from the PiAPI workspace. On shared machines, use the environment variable PIAPI_API_KEY=sk-... instead.

Can I generate AI images from terminal?

Yes. Use piapi run flux-dev prompt="a corgi astronaut" or another image model to generate AI images from terminal commands. Add --download to save generated files locally.

How do I upload local files?

Prefix any input with @ to upload a local file. For example: piapi run remove-bg image=@./photo.png. The file is automatically uploaded before the model runs. Upload requires a paid PiAPI plan.

Can I use this with AI agents like Claude Code or Cursor?

Yes! PiAPI CLI is designed for AI agent integration. Add it as a skill with npx skills add PiAPI-1/piapi-cli.

Is PiAPI CLI free?

The CLI itself is free and open source (MIT license). You need a PiAPI account to use the models - new accounts get free credits to try. See piapi.ai/pricing for model pricing.

How do I install PiAPI CLI?

Install globally with npm: npm install -g piapi-cli. You can also use pnpm, yarn, or bun. Alternatively, run without installing using npx piapi-cli@latest. Requires Node.js 18+.

What models are supported?

PiAPI CLI supports 94 multimodal AI models: 34 image models (Flux, Seedream, Nano Banana), 40 video models (Sora 2, Kling 3, Veo 3), 10 audio models (F5-TTS, MMAudio), 2 3D models (Trellis), and 8 LLM models (GPT-4o, Claude). Run piapi model list to see all available models.

Can I generate AI videos from terminal?

Yes. Use video models such as Sora, Kling, Veo, Seedance, Hailuo, and Luma to generate AI videos from terminal workflows. Video jobs usually use --async so you can check task status later.

How do I download generated files?

Add --download to any command to automatically save generated files. Use --out-dir ./output to specify a custom output directory. Works for both URL outputs and base64 payloads.

What's the difference between sync and async modes?

LLM and gpt-image-2 models run synchronously (results return immediately). Video and 3D models require --async flag and return a task ID for polling. Use piapi task get <id> to check status.