$ piapi run flux-dev prompt="a corgi" aspect_ratio=16:9生成圖像
執行 piapi model list 瀏覽所有模型
$ piapi run flux-dev prompt="a corgi astronaut"$ piapi run flux-dev prompt="a corgi" aspect_ratio=16:9生成圖像
$ piapi run gpt-4o prompt="hello" --stream串流聊天
$ piapi run sora2-pro prompt="waves" --async生成影片(非同步)
$ piapi run remove-bg image=@./photo.png --download上傳並下載

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.
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.
執行 piapi auth login --api-key sk-xxxxx 並輸入您的 PiAPI API key。您可以從 PiAPI 工作區取得 API key。在共享機器上,建議使用環境變數 PIAPI_API_KEY=sk-...。
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.
在任何輸入前加上 @ 前綴即可上傳本地檔案。例如:piapi run remove-bg image=@./photo.png。
可以!PiAPI CLI 專為 AI 代理整合設計。使用 npx skills add PiAPI-1/piapi-cli 新增技能。
CLI 本身免費且開源(MIT 授權)。使用模型需要 PiAPI 帳戶——新帳戶可獲得免費額度試用。
使用 npm 全域安裝:npm install -g piapi-cli。也可以使用 pnpm、yarn 或 bun。或者使用 npx piapi-cli@latest 無需安裝直接執行。需要 Node.js 18+。
PiAPI CLI 支援 94 個多模態 AI 模型:34 個圖像模型、40 個影片模型、10 個音訊模型、2 個 3D 模型和 8 個 LLM 模型。執行 piapi model list 查看所有可用模型。
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.
在任何指令中新增 --download 即可自動儲存生成的檔案。使用 --out-dir ./output 指定自訂輸出目錄。
LLM 和 gpt-image-2 模型同步執行。影片和 3D 模型需要 --async 參數並回傳任務 ID 用於輪詢。