Skip to content

Repository files navigation

PiAPI Skills for Claude, Codex, Hermes, OpenClaw, and others

🇺🇸 English. Leia em português: README.pt-BR.md.

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.

Watch the tutorial (1 min)

PiAPI Skills tutorial — animated preview

▶︎ Full MP4 · Cover · Per-scene stills · Source (Remotion)

A 9-scene animated walkthrough — install, configure PIAPI_API_KEY, CLI tour, model catalog, async submit/poll/result flow, and per-agent skill paths. Built with Remotion; edit and re-render from presentation/remotion-tutorial/.

Scene gallery


1. Intro

2. What is it

3. Install

4. Configure

5. CLI tour

6. Models

7. Workflow

8. Agents

9. Outro

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:

  1. Provisions a Python 3.10+ virtualenv at ~/.local/share/piapi-skill/venv and installs requests.
  2. Drops piapi-cli into ~/.local/bin (add to PATH if missing).
  3. Copies the appropriate SKILL.md into each detected agent skill root.

Agent skill paths the installer writes to:

AgentPath
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

FileWhat it covers
examples/01-text-to-image-flux.mdFlux txt2img — shell, raw envelope, Python.
examples/02-midjourney-imagine-upscale.mdTwo-step imagine + upscale, Staged status, process_mode.
examples/03-kling-image-to-video.mdKling image2video / text2video / extend with mode + duration.
examples/04-suno-music.mdSuno generate_music + custom + extend + concat + add_lyrics.
examples/05-faceswap.mdImage, multi-face, video faceswap; target_index zero-based.
examples/06-hunyuan-video.mdHunyuan txt2video-lora + img2video-lora; LoRA URL + strength.
examples/07-llm-chat.mdSync OpenAI-compatible LLM, streaming, OpenAI SDK base_url override.
examples/08-webhooks.mdFlask + Express receivers, constant-time secret check, retry policy.

References

FileTopic
references/rest-api.mdSubmit / fetch / cancel envelopes, headers, status drift, polling.
references/models.mdPer-family model + task_type + input keys for every supported family.
references/errors.mdHTTP status interpretation + per-model gotchas + CLI errors.
references/webhooks.mdNo-HMAC verification pattern, retry policy, recovery via polling.
references/rate-limits.mdFree/Creator/Pro/Enterprise tier table + concurrency planning.

Surface map

FamilymodelCommon task_typeStatus casing
Midjourneymidjourneyimagine, upscale, variation, inpaint, describe, blendCapitalized
FluxQubico/flux1-schnell, Qubico/flux1-dev, Qubico/flux1-dev-advancedtxt2img, img2img, inpaint, controlnet-lora, redux-variationlowercase
Geminigemininano-banana-text-to-image, nano-banana-editlowercase
Klingklingtext2video, image2video, extend, lipsync, effectsCapitalized
Lumalumatext2video, image2video, extendlowercase
Hailuohailuotext2video, image2video, subject2videolowercase
Veo 3veo3txt2vid, img2vidlowercase
Seedance 2seedancetext-to-video, image-to-videolowercase
HunyuanQubico/hunyuantxt2video-lora, img2video-loralowercase
Sunomusic-ugenerate_music, generate_music_custom, extend, concat, add_lyricslowercase
MMAudioQubico/mmaudiovideo2audiolowercase
F5-TTSQubico/f5-ttstxt2speechlowercase
TrellisQubico/trellisimage-to-3dlowercase
Faceswap (image)Qubico/image-toolkitface-swap, multi-face-swapCapitalized
Faceswap (video)Qubico/video-toolkitface-swapCapitalized
LLMOpenAI-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.

About

Skill bundle for Claude, Codex, Hermes, OpenClaw, Cursor, Windsurf, and generic agents covering PiAPI (Midjourney, Suno, Kling, Flux, Hailuo, Luma, Hunyuan, Faceswap, Trellis 3D, MMAudio, F5-TTS, Veo 3, Gemini 2.5 Flash Image, Seedance, and the OpenAI-compatible LLM gateway).

Topics

Resources

Code of conduct

Contributing

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages