Quickstart
Base URL
https://api.plan2api.com/v1OpenAI-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.pngParameters
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
backgroundopaque(default),transparentorauto
- 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 thequalityand the response says which. - Past 90 seconds the 200 goes out early, so a late failure comes back as a 200 with an
errorbody.
Set up a tool
CursorAI code editor
- Open Cursor Settings and go to Models.
- Under OpenAI, paste your key into API Key, press Enter and turn on Use API Key.
- Turn on the Base URL override and enter the base URL.
- 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
- Click the gear icon in the Cline panel.
- Set API Provider to OpenAI Compatible.
- 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
- Open your
config.yamlfrom the gear next to Local Config, or edit~/.continue/config.yaml. - Add this under
models:and save. Swap in your key.
models: - name: "claude/claude-sonnet-5" provider: openai model: "claude/claude-sonnet-5" apiBase: "https://api.plan2api.com/v1" apiKey: "p2a_..." useResponsesApi: falseOpen WebUISelf-hosted chat UI
- Go to Settings > Admin > Connections.
- Under Manage OpenAI API Connections, click Add Connection.
- Enter the URL and API Key, click Verify Connection, then Save.
- 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
- Add an OpenAI Chat Model node and create a new credential.
- Enter the API Key and Base URL, then save.
- Pick the model from the list, or switch Model to ID and paste it.
- Leave Use Responses API off.
- API Key
p2a_...your key- Base URL
https://api.plan2api.com/v1- Model
claude/claude-sonnet-5
ZedCode editor
- Run
agent: open settingsfrom the command palette. - Under LLM Providers, click Add Provider.
- 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