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"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:
At a glance
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.
This section explains when PiAPI CLI is the better path, and when a direct API or a model-specific tool may still make sense.
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.
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.
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
PiAPI CLI works as a Flux CLI, Sora CLI, Kling CLI, Veo CLI, GPT image CLI, and Claude CLI through one command format.
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"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" --asyncGenerate AI videos from terminal commands with Kling models for motion-heavy video scenes.
piapi run kling-3 prompt="camera pushes through neon city"Run Veo video generation from scripts, prototypes, or AI agent workflows.
piapi run veo3-fast prompt="aerial shot of a mountain road"Create images, icons, and visual concepts from prompts with GPT image models.
piapi run gpt-image-2 prompt="a clean app icon"Send writing, summarization, and coding prompts to Claude models from the terminal.
piapi run claude-sonnet-4.6 prompt="rewrite this launch note"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.
Use piapi-cli for common AI CLI workflows, from text-to-image generation to async video tasks and local file uploads.
CLI Commands
Complete PiAPI command line interface reference for authentication, model discovery, generation, downloads, and async tasks.
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
--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 colorsDeveloper guides
Read the CLI quick start and terminal image generation guide to connect PiAPI CLI with real developer automation workflows.

Install PiAPI CLI, authenticate your API key, and run your first image or video generation command from the terminal.

Use PiAPI CLI as a command line AI tool to generate images from terminal prompts, save outputs locally, and automate repeatable image workflows.