Quickstart

Base URL
https://api.plan2api.com/v1

OpenAI-compatible, /v1 included.

API key

Send a request

​curl https://api.plan2api.com/v1/chat/completions \  -H "Authorization: Bearer $PLAN2API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "claude/claude-sonnet-5",    "messages": [{ "role": "user", "content": "Hello" }]  }'

Endpoints

POST/v1/chat/completions
Chat, streaming, tool calls and image input
GET/v1/models
The models your key can use
POST/v1/images/generations
Images from a prompt, on Pro and Scale
POST/v1/images/edits
Edits of up to 5 images, on Pro and Scale
  • Send the key as Authorization: Bearer.
  • There's no Responses API. If a tool asks, pick Chat Completions.
  • The snippets read your key from PLAN2API_KEY.

Generate images

​curl https://api.plan2api.com/v1/images/generations \  -H "Authorization: Bearer $PLAN2API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-image-2",    "prompt": "A red fox asleep in fresh snow at golden hour",    "size": "1536x1024"​  }' \  | jq -r '.data[0].b64_json' | base64 --decode > fox.png

Parameters

prompt
What to draw, up to 32,000 characters
size
Sets the aspect ratio, 1:3 to 3:1. Images come out at about 1.6 megapixels.
n
1 to 4 images, rendered in parallel
background
opaque (default), transparent or auto
  • Renders use your Codex subscription and its image limits, which are separate from chat.
  • A render takes 15 seconds to 2 minutes, so keep client timeouts above that.
  • PNG only, as b64_json. The model picks the quality and the response says which.
  • Past 90 seconds the 200 goes out early, so a late failure comes back as a 200 with an error body.

Set up a tool

CursorAI code editor
  1. Open Cursor Settings and go to Models.
  2. Under OpenAI, paste your key into API Key, press Enter and turn on Use API Key.
  3. Turn on the Base URL override and enter the base URL.
  4. Add the model id to your models and pick it in chat.
API Key
p2a_... your key
Base URL
https://api.plan2api.com/v1
Model
claude/claude-sonnet-5
ClineCoding agent for VS Code
  1. Click the gear icon in the Cline panel.
  2. Set API Provider to OpenAI Compatible.
  3. Fill in Base URL, API Key and Model ID, then click Verify.
Base URL
https://api.plan2api.com/v1
API Key
p2a_... your key
Model ID
claude/claude-sonnet-5
ContinueVS Code and JetBrains extension
  1. Open your config.yaml from the gear next to Local Config, or edit ~/.continue/config.yaml.
  2. Add this under models: and save. Swap in your key.
config.yaml
models:  - name: "claude/claude-sonnet-5"​    provider: openai    model: "claude/claude-sonnet-5"​    apiBase: "https://api.plan2api.com/v1"​    apiKey: "p2a_..."​    useResponsesApi: false
Open WebUISelf-hosted chat UI
  1. Go to Settings > Admin > Connections.
  2. Under Manage OpenAI API Connections, click Add Connection.
  3. Enter the URL and API Key, click Verify Connection, then Save.
  4. Your models show up in the model selector.
URL
https://api.plan2api.com/v1
API Key
p2a_... your key
Model
claude/claude-sonnet-5
n8nWorkflow automation
  1. Add an OpenAI Chat Model node and create a new credential.
  2. Enter the API Key and Base URL, then save.
  3. Pick the model from the list, or switch Model to ID and paste it.
  4. Leave Use Responses API off.
API Key
p2a_... your key
Base URL
https://api.plan2api.com/v1
Model
claude/claude-sonnet-5
ZedCode editor
  1. Run agent: open settings from the command palette.
  2. Under LLM Providers, click Add Provider.
  3. Fill in the provider name, API URL, model ID and context window, then add your key.
Provider name
Plan2API
API URL
https://api.plan2api.com/v1
Model ID
claude/claude-sonnet-5
API key
p2a_... your key