Provider-agnostic CLI for the PiAPI inference platform — Midjourney, Flux, Kling, Suno, Hailuo, Veo 3, Hunyuan, Faceswap, Trellis 3D, MMAudio, F5-TTS and the OpenAI-compatible LLM proxy. Single-file Python with a thin shell shim, plus skill bundle for Claude Code, Codex, Hermes, OpenClaw.
Project description
PiAPI Skills for Claude, Codex, Hermes, OpenClaw, and others
Single skill bundle that teaches AI coding agents how to drive PiAPI — Midjourney, Flux, Kling, Luma, Hailuo, Veo 3, Suno, Hunyuan, Faceswap, Trellis 3D, MMAudio, F5-TTS, Gemini Nano Banana, Seedance 2, plus the OpenAI-compatible LLM proxy — through one CLI.
Not affiliated with PiAPI. "PiAPI" is a trademark of its respective owner.
Install
curl -fsSL https://raw.githubusercontent.com/wesleysimplicio/PiAPI-Skills/master/install.sh | bash
Or clone and run:
git clone https://github.com/wesleysimplicio/PiAPI-Skills.git
cd PiAPI-Skills
./install.sh
Flags:
./install.sh --yes # non-interactive
./install.sh --agents claude,codex,hermes # install only listed agents
./install.sh --uninstall # remove CLI + agent skills
The installer:
- Provisions a Python 3.10+ virtualenv at
~/.local/share/piapi-skill/venvand installsrequests. - Drops
piapi-cliinto~/.local/bin(add toPATHif missing). - Copies the appropriate
SKILL.mdinto each detected agent skill root.
Agent skill paths the installer writes to:
| Agent | Path |
|---|---|
| Claude Code | ~/.claude/skills/piapi/SKILL.md |
| Codex | ~/.codex/skills/piapi/SKILL.md |
| Hermes | ~/.hermes/skills/creative/piapi/SKILL.md |
| OpenClaw | ~/.openclaw/skills/piapi/SKILL.md |
| Cursor | ~/.cursor/skills/piapi/SKILL.md |
| Windsurf | ~/.windsurf/skills/piapi/SKILL.md |
| Generic | ~/.config/agents/skills/piapi/SKILL.md |
Configure
Set the API key from https://piapi.ai/workspace/key:
export PIAPI_API_KEY="<your key>"
# optional, only if you receive webhooks:
export PIAPI_WEBHOOK_SECRET="<your shared secret>"
Persist in your shell rc (~/.zshrc, ~/.bashrc).
CLI tour
piapi-cli --help # subcommand list
piapi-cli models # list known model · task_type pairs
piapi-cli imagine "studio portrait, calico cat" --aspect 1:1 # Midjourney imagine
piapi-cli flux "cyberpunk alley at night" # Flux schnell txt2img
piapi-cli kling --image-url https://… --prompt "slow zoom" # Kling image2video
piapi-cli suno --prompt "lofi piano under rain" # Suno music
piapi-cli faceswap --target-image https://… --swap-image … # Faceswap (image)
piapi-cli submit --model <m> --task-type <t> --input '{...}' # generic submit
piapi-cli wait <task_id> # poll until terminal
piapi-cli result <task_id> # fetch one snapshot
piapi-cli cancel <task_id> # cancel pending only
piapi-cli run --model <m> --task-type <t> --input '{...}' # submit + wait + print
piapi-cli llm --model gpt-4o-mini --message 'user:Hi' # sync chat completion
piapi-cli verify-webhook --header-secret X --expected Y # constant-time compare
Add --webhook-url and --webhook-secret to any submit-style command to
register a callback.
Examples
| File | What it covers |
|---|---|
examples/01-text-to-image-flux.md |
Flux txt2img — shell, raw envelope, Python. |
examples/02-midjourney-imagine-upscale.md |
Two-step imagine + upscale, Staged status, process_mode. |
examples/03-kling-image-to-video.md |
Kling image2video / text2video / extend with mode + duration. |
examples/04-suno-music.md |
Suno generate_music + custom + extend + concat + add_lyrics. |
examples/05-faceswap.md |
Image, multi-face, video faceswap; target_index zero-based. |
examples/06-hunyuan-video.md |
Hunyuan txt2video-lora + img2video-lora; LoRA URL + strength. |
examples/07-llm-chat.md |
Sync OpenAI-compatible LLM, streaming, OpenAI SDK base_url override. |
examples/08-webhooks.md |
Flask + Express receivers, constant-time secret check, retry policy. |
References
| File | Topic |
|---|---|
references/rest-api.md |
Submit / fetch / cancel envelopes, headers, status drift, polling. |
references/models.md |
Per-family model + task_type + input keys for every supported family. |
references/errors.md |
HTTP status interpretation + per-model gotchas + CLI errors. |
references/webhooks.md |
No-HMAC verification pattern, retry policy, recovery via polling. |
references/rate-limits.md |
Free/Creator/Pro/Enterprise tier table + concurrency planning. |
Surface map
| Family | model |
Common task_type |
Status casing |
|---|---|---|---|
| Midjourney | midjourney |
imagine, upscale, variation, inpaint, describe, blend |
Capitalized |
| Flux | Qubico/flux1-schnell, Qubico/flux1-dev, Qubico/flux1-dev-advanced |
txt2img, img2img, inpaint, controlnet-lora, redux-variation |
lowercase |
| Gemini | gemini |
nano-banana-text-to-image, nano-banana-edit |
lowercase |
| Kling | kling |
text2video, image2video, extend, lipsync, effects |
Capitalized |
| Luma | luma |
text2video, image2video, extend |
lowercase |
| Hailuo | hailuo |
text2video, image2video, subject2video |
lowercase |
| Veo 3 | veo3 |
txt2vid, img2vid |
lowercase |
| Seedance 2 | seedance |
text-to-video, image-to-video |
lowercase |
| Hunyuan | Qubico/hunyuan |
txt2video-lora, img2video-lora |
lowercase |
| Suno | music-u |
generate_music, generate_music_custom, extend, concat, add_lyrics |
lowercase |
| MMAudio | Qubico/mmaudio |
video2audio |
lowercase |
| F5-TTS | Qubico/f5-tts |
txt2speech |
lowercase |
| Trellis | Qubico/trellis |
image-to-3d |
lowercase |
| Faceswap (image) | Qubico/image-toolkit |
face-swap, multi-face-swap |
Capitalized |
| Faceswap (video) | Qubico/video-toolkit |
face-swap |
Capitalized |
| LLM | OpenAI-style model (gpt-4o-mini, claude-3-5-sonnet, etc.) |
n/a (sync /v1/chat/completions) |
n/a |
Status enum drift
Lowercase before comparing. Staged (Midjourney) is not terminal —
follow up with upscale / variation. Treat
completed | complete | success | succeeded as terminal-success and
failed | failure | error | canceled | cancelled | rejected as
terminal-failure.
Webhooks
PiAPI does not sign payloads with HMAC. The secret you registered on
the task is echoed in the x-webhook-secret request header. Constant-time
compare against your stored secret.
Retry policy: every 5s, up to 3 attempts on any non-2xx. After three
failures, recover by polling piapi-cli result <task_id>.
Contributing
PRs welcome — see CONTRIBUTING.md and the
CODE_OF_CONDUCT.md.
License
MIT — see LICENSE and NOTICE for attribution
caveats and trademark disclaimers.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file piapi_skills-1.2.0.tar.gz.
File metadata
- Download URL: piapi_skills-1.2.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53d02284ae1593f281ce47dbc6ec621d5085f7c7457bbd92d64a814724d49518
|
|
| MD5 |
0eb9580c8b00ed20208efabd1c4b989f
|
|
| BLAKE2b-256 |
97ab60925b3719e5919567552854ce00f5d657edfe31e7a4a467fa2b27b34bfd
|
File details
Details for the file piapi_skills-1.2.0-py3-none-any.whl.
File metadata
- Download URL: piapi_skills-1.2.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3edb3b4feac55e97c1d152d735c5655a47527229b58d7fab85a5fb68f7b8208f
|
|
| MD5 |
4956eb127b708e3e074ebc3697d3ae48
|
|
| BLAKE2b-256 |
e6a67a2c9f5594552f271e0c1cc0bd88630af3dc9c3b2320d931ea4a3dc3b4e1
|