v0.1.1AI Agent Ready

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
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

At a glance

What PiAPI CLI does

PiAPI CLI, also published as piapi-cli on npm, is the official PiAPI command line interface for running image, video, audio, 3D, and chat models from a terminal or AI agent workflow.

Key facts

94
multimodal AI models supported
34
image generation models and tools
40
video generation models
10
audio, music, and TTS models
2
3D generation models
8
LLM chat models with streaming support

Which workflow should you choose?

This section explains when PiAPI CLI is the better path, and when a direct API or a model-specific tool may still make sense.

PiAPI CLI

Recommended for CLI

Use when: you want one AI CLI tool to run image, video, audio, 3D, and chat models from the terminal.

Keep in mind: best for fast experiments, scripts, AI agents, and repeatable generation tasks.

Direct API calls

Use when: you are building a production app and need full control over request handling and custom UI logic.

Keep in mind: you write more integration code for auth, uploads, polling, downloads, and retries.

Model-specific tools

Use when: you only need one provider or one model family for a narrow experiment.

Keep in mind: switching between Flux, Sora, Kling, Veo, GPT, Claude, and other models usually means changing tools.

In short: use PiAPI CLI when the job starts in the terminal and needs access to many AI models through one command format.

Popular model commands

Run Flux, Sora, Kling, Veo, GPT, and Claude from one CLI

PiAPI CLI works as a Flux CLI, Sora CLI, Kling CLI, Veo CLI, GPT image CLI, and Claude CLI through one command format.

Flux CLI

Generate AI images from terminal prompts with Flux models for product shots, concepts, and creative assets.

piapi run flux-dev prompt="product photo on white background"

Sora CLI

Start async text-to-video jobs from the command line for cinematic clips and short video ideas.

piapi run sora2-pro prompt="cinematic ocean waves" --async

Kling CLI

Generate AI videos from terminal commands with Kling models for motion-heavy video scenes.

piapi run kling-3 prompt="camera pushes through neon city"

Veo CLI

Run Veo video generation from scripts, prototypes, or AI agent workflows.

piapi run veo3-fast prompt="aerial shot of a mountain road"

GPT image CLI

Create images, icons, and visual concepts from prompts with GPT image models.

piapi run gpt-image-2 prompt="a clean app icon"

Claude CLI

Send writing, summarization, and coding prompts to Claude models from the terminal.

piapi run claude-sonnet-4.6 prompt="rewrite this launch note"

Everything you need

One AI CLI Tool for Multimodal Models

Use PiAPI CLI as a multimodal AI CLI for image, video, audio, 3D, and chat workflows. No context switching between different APIs.

Image Generation
Generate AI images from terminal commands with 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
Generate AI videos from terminal workflows with 40 models including Sora 2, Kling 3, Veo 3, Seedance 2, Hailuo, and Luma.
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-to-3D), trellis2 (image-to-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
Use PiAPI CLI in AI agent workflows, scripts, and automated command line tasks. 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

Use piapi-cli for common AI CLI workflows, from text-to-image generation to async video tasks and local file uploads.

# Generate 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 & download
piapi run remove-bg image=@./photo.png --download

Reference

CLI Commands

Complete PiAPI command line interface reference for authentication, model discovery, generation, downloads, and async tasks.

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?