Skip to content

PiAPI MCP

PiAPI provides image, video and audio generation through a hosted API. An agent can submit image generation tasks and retrieve their results. Add your PiAPI key once in Longwave settings; calls run on your vendor account.

Add to Longwave

Add PiAPI to your agent

Paste this into Claude Code or a terminal. Then run /mcp to sign in.

functions
2
access
Your key
tasks
1

Use PiAPI on Longwave

  1. Download Longwave or open app.longwave.run.
  2. Add your PiAPI API key once in Longwave settings. Calls run on your PiAPI account at PiAPI's price.
  3. Ask for the result in any thread, for example: “Generate an image from a campaign brief”. The agent picks the PiAPI function and calls it.

Use PiAPI in Claude Code, Codex, Cursor or ChatGPT

Add the Longwave MCP server once. It carries 2,593 functions across 103 tools, including PiAPI, and asks you to sign in on first use.

Why call PiAPI through Longwave

  • Your PiAPI key is stored once, encrypted, and used by every harness and device you use.
  • One MCP server for 103 tools, so your agent setup does not grow a key and a server per vendor.
  • Spending limits per key and per account, checked before a paid call is made.
  • Each call is recorded with the provider, the cost and the result, and can be read again from another device.

PiAPI functions

Image generation 1

Function Price
Generate an image from text Accepts a text prompt and returns a receipt for a FLUX Schnell image generation request. piapi.image.submit
See vendor pricing.

PiAPI 1

Function Price
Get a PiAPI task result Accepts a task ID and returns the task status and output references. piapi.task.get
Task status and result retrieval; generation is billed at submission, with no separate published polling fee.

Prices are PiAPI's published rates. Source: PiAPI pricing.

Use cases

Questions people ask

How do I get a PiAPI API key?

Sign in to PiAPI and create a key at piapi.ai/workspace. Add it once in Longwave settings and your agents' PiAPI calls run on your own account. PiAPI API keys

Do I need a PiAPI account?

Yes. Create a key at https://piapi.ai/workspace and add it in Longwave settings. Longwave stores it encrypted and uses it only for your calls.

How do I use PiAPI in Claude Code?

Add the Longwave MCP server once with claude mcp add --transport http longwave https://api.longwave.run/v1/mcp/tasks, sign in, and ask for what you need. Claude finds the right PiAPI function and calls it.

Use PiAPI in Longwave

Ask any Longwave thread for the result, or add Longwave to Claude Code, Codex, Cursor or ChatGPT.

Add to Longwave