n8n integration

Use Plan2API in n8n with an OpenAI credential

To use a Claude, ChatGPT, Gemini or Kimi plan in n8n, create an OpenAI credential with Base URL https://api.plan2api.com/v1 and a p2a_ key, then turn off Use Responses API (on by default in node version 1.3). Plan2API's Free plan covers 50 chat requests a day; Pro is $12 a month with no cap.

Credential type
OpenAI
Base URL
https://api.plan2api.com/v1
Use Responses API
Off
Free plan
50 chat requests a day

Updated

n8n settings for Plan2API

n8n connects to Plan2API through its built-in OpenAI credential and the OpenAI Chat Model node, so a single credential covers your Claude, ChatGPT (Codex), Gemini and Kimi models, including using a Claude plan as an API. The table below lists the exact credential and node values you need.

n8n values for Plan2API
WhereFieldValue
OpenAI credentialAPI KeyYour p2a_ key
OpenAI credentialOrganization IDLeave empty
OpenAI credentialBase URLhttps://api.plan2api.com/v1
OpenAI Chat ModelModelFrom List, or ID such as claude/claude-sonnet-5
OpenAI Chat ModelUse Responses APIOff
OptionsTimeoutRaise from 60000 ms for long replies
OptionsMax Retries2 (the default)

Create the OpenAI credential

  1. Sign up with a Google account, connect your subscription, and copy the p2a_ key from the dashboard.
  2. In n8n, create a new credential of type OpenAI.
  3. Paste your key into API Key, leave Organization ID blank, and change the Base URL from https://api.openai.com/v1 to https://api.plan2api.com/v1, keeping /v1 at the end because n8n appends /models and /chat/completions to whatever Base URL you enter.
  4. Click save, and n8n will test the credential by sending GET /models with an Authorization: Bearer header.

The credential test and the From List model picker both call GET /v1/models, which isn't a chat request, so neither uses up any of the Free plan's 50 chat requests a day.

Set up the OpenAI Chat Model node

  1. Add an AI Agent or Basic LLM Chain node to your workflow and attach an OpenAI Chat Model sub-node as its chat model.
  2. Select the Plan2API credential you just saved.
  3. Choose a model using From List, which pulls every id that GET /v1/models returns when you're on a custom Base URL, or switch the field to ID and type the model id yourself.
  4. Turn off Use Responses API, which version 1.3 of the node turns on by default and which calls /v1/responses, an endpoint Plan2API doesn't serve.

Here are the model ids you can pick or type into the node.

Plan2API model ids for n8n
Model idSubscriptionContext window
claude/claude-sonnet-5Claude Pro or Max1M tokens
claude/claude-opus-5-5Claude Pro or Max1M tokens
claude/claude-haiku-4-5Claude Pro or Max200K tokens
openai/gpt-6.1-solChatGPT plan (Codex)Listed by GET /v1/models
gemini/gemini-3.8-flash-highGoogle AI Pro or Ultra1,048,576 tokens
kimi/k3Kimi Code membership1,048,576 tokens

What works in n8n and what doesn't

These n8n features work across your connected plans:

  • AI Agent tool and function calling works on all four providers.
  • Basic LLM Chain prompts work on every connected provider.
  • Image input works on Claude, Gemini and Kimi models, plus Codex models that accept images.
  • Response Format set to JSON (json_object) works on Codex, Gemini and Kimi models; the node's JSON Schema option only exists with Use Responses API on, which Plan2API doesn't serve.

These n8n features don't work because the underlying endpoints or parameters aren't supported:

  • Use Responses API and its Built-in Tools like Web Search fail because there's no /v1/responses endpoint.
  • The Embeddings OpenAI node fails because there's no /v1/embeddings endpoint.
  • Response Format set to JSON on Claude models returns HTTP 400 unsupported_parameter.

In the node's Options, Sampling Temperature and Top P are ignored on Claude and Codex models, passed through on Gemini models, and fixed on Kimi (temperature 1, top_p 0.95).

Limits, timeouts and retries

Your subscription's own usage limits apply to every workflow run, and Plan2API adds no token quota on top of what you already pay your provider for (see how Claude's own usage limits work). When every connected account for a provider runs out of quota, the API returns HTTP 429 subscription_quota_exhausted with a Retry-After header in seconds.

Plan2API's Free plan allows 50 chat requests a day (resetting at 00:00 UTC), 1 request per second with bursts up to 20, and 4 requests at once, while Pro has no daily cap, 10 requests per second with bursts up to 600, and 16 requests at once. Keep in mind that an AI Agent sends one chat request per model call, so a single run that loops through several tool calls uses several chat requests.

Raise the node's Timeout above its 60000 ms default if you run long reasoning replies, and leave Max Retries at its default of 2 so a short HTTP 429 gets another try.

Run n8n workflows on your own subscriptions

One p2a_ key covers every subscription you connect in Plan2API, so a single n8n credential serves Claude, Codex, Gemini and Kimi models and you switch providers just by changing the model id prefix (claude/, openai/, gemini/, or kimi/). If you connect more than one account from the same provider, a request that hits a usage limit automatically moves to your next connected account before any output is sent.

Plan2API Free is $0 for 1 connected subscription and 50 chat requests a day, Pro is $12 a month or $99 a year for 3 subscriptions with no daily request cap, and Scale is $29 a month or $249 a year for 25 subscriptions; you can compare all plan details and limits on the pricing page. If you use n8n Cloud, supported nodes also offer Use Gateway credits in the credential field, which runs the node without your own OpenAI account.

Troubleshooting n8n with Plan2API

  • HTTP 401 invalid_api_key: the API Key field in your n8n credential is empty, holds the wrong string, or doesn't start with p2a_.
  • HTTP 403 no_credentials: your vault doesn't have a connected subscription for the provider prefix in your model id, so connect that provider in the dashboard.
  • HTTP 400 model_not_found: the model id typed in ID mode isn't recognized, so switch to From List or pick an exact id returned by GET /v1/models.
  • HTTP 400 unsupported_parameter: Response Format is set to JSON on a claude/ model, so change Response Format back to text or switch to a Codex, Gemini or Kimi model.
  • The OpenAI Chat Model node fails on every run: Use Responses API is still turned on in node version 1.3, so open the node and toggle it off.
  • HTTP 429 daily_requests: you've hit the 51st chat request of the day on the Free plan, which resets at 00:00 UTC; the response's Retry-After header gives the seconds until then.

Check the API reference and full error list for details on other status codes, or run this curl command to list every valid model id with your key.

curl
curl https://api.plan2api.com/v1/models \
  -H "Authorization: Bearer $PLAN2API_KEY"

Use the AI subscriptions you already pay for as one OpenAI-compatible API key.

  • Free: 1 subscription, 50 requests a day, no card
  • Pro: $12 a month

FAQ

Can I use my Claude Pro or Max subscription in n8n?

Yes, you can connect it through Plan2API by creating an n8n OpenAI credential with Base URL set to https://api.plan2api.com/v1 and your p2a_ key. Then select claude/claude-sonnet-5 in the OpenAI Chat Model node and turn off Use Responses API.

Should the n8n Base URL end in /v1?

Yes, enter https://api.plan2api.com/v1 with /v1 at the end. n8n appends /models and /chat/completions directly to that URL.

Why does the OpenAI Chat Model node fail with Plan2API?

Usually it fails because Use Responses API is still on, which is the default setting in node version 1.3. Plan2API only serves Chat Completions at /v1/chat/completions, so turn Use Responses API off in the node.

Does the Embeddings OpenAI node work with Plan2API?

No, the Embeddings OpenAI sub-node doesn't work with Plan2API. There is no /v1/embeddings endpoint, so you'll need to use another embeddings provider for vector stores.

Does the n8n credential test use up Free plan requests?

No, testing your credential in n8n doesn't use any Free plan requests. The test calls GET /v1/models, and the Free plan's 50-request daily limit only counts chat requests sent to POST /v1/chat/completions.

Sources

  1. n8n docs: OpenAI credentialsdocs.n8n.io
  2. n8n docs: OpenAI Chat Model nodedocs.n8n.io
  3. n8n source: OpenAI Chat Model nodegithub.com
  4. n8n source: OpenAI credentialgithub.com