Skip to content

Configure n8n's OpenAI credential and model endpoint

n8n is the workflow automation platform where AI steps meet real business processes, and every AI Agent, Basic LLM Chain and OpenAI node bills through the credential you give it. n8n's OpenAI credential has a Base URL field: set it to https://api.router.one/v1 and one credential reaches the Claude, GPT, Gemini, Grok and DeepSeek chat models in the catalog, with each model call recorded in Dashboard → Logs. Which endpoint a step actually calls depends on the node. In its current version the OpenAI Chat Model sub-node sends the Responses API by default and Chat Completions once you turn that off; the OpenAI node's Message a Model action always sends Responses; and the Embeddings OpenAI sub-node needs an embeddings endpoint, which Router One does not have. n8n orchestrates the workflow and the gateway meters it, and a maxSpend cap on the key keeps a scheduled workflow from running past its budget. Checked against n8n 2.41.3 (the npm latest and stable release, September 25, 2026) on 2026-09-29, per n8n's source.

Create the credential and a dedicated key

Create a Router One key for n8n and give it a maxSpend cap; a key per environment, such as one for testing and one for production workflows, keeps their spend apart in Dashboard → Logs. Scheduled and webhook-triggered workflows run with nobody watching, so the cap is the hard stop. In n8n, open Credentials → Add credential → OpenAI, or create one from the credential dropdown of any OpenAI node. The form has API Key, Organization ID (optional; leave it blank), Base URL, which defaults to https://api.openai.com/v1, and an Add Custom Header switch that Router One does not need. When you save, n8n tests the credential with GET {Base URL}/models; Router One answers that call only for a valid key, so a passing test confirms both the key and the URL.

Configure n8n to use the Router One base URL

Set Base URL to https://api.router.one/v1 and paste the key. Then select this credential in the node. The OpenAI Chat Model node loads its model list from GET {Base URL}/models with the key, and on any Base URL other than api.openai.com it lists every catalog ID, image-generation models included, so pick a chat model, or switch the Model field to ID and paste the exact ID from /models:

Base URL
https://api.router.one/v1
n8n-openai-credential
# n8n → Credentials → Add credential → OpenAI
API Key:   sk-your-router-one-key
Base URL:  https://api.router.one/v1
# Organization ID: leave blank · Add Custom Header: off
# OpenAI Chat Model node (version 1.3): Model = an exact chat ID from /models
# Use Responses API: off for Claude or Gemini IDs; on only if the model page lists /v1/responses
# Embeddings: a separate credential for a provider that serves embeddings

The Use Responses API toggle in the OpenAI Chat Model node

The OpenAI Chat Model node has versions 1 to 1.3, and a node added today is version 1.3. That version shows a Use Responses API switch that is on by default (per the node's source in n8n 2.41.3), so a new node sends POST /v1/responses. Router One serves that endpoint for the GPT-family, DeepSeek and Grok chat IDs whose model pages list it. A Claude-family ID is rejected there with HTTP 400 invalid_request_error and model '<id>' must be called via /v1/messages or /v1/chat/completions, and Gemini IDs are not served there either. Turn the switch off and the node sends Chat Completions, which serves every chat model in the catalog. While the switch is on, the node also offers Built-in Tools (web search, file search and code interpreter). On the IDs Router One serves natively on /v1/responses, hosted tool fields are forwarded as sent and metered, but Router One does not execute tools itself. File search needs vector store IDs, and Router One serves no Files or Vector Stores API to create them, so leave file search off; confirm web search or code interpreter on one real request before relying on it. Nodes created before version 1.3 do not show the switch.

Options that change the request

Options on the OpenAI Chat Model node go into each request. Timeout defaults to 60,000 ms and applies to the response headers and body, and Max Retries defaults to 2: a long generation can outlast a minute, so raise Timeout for slow models, and remember that each retry is a separate request in Dashboard → Logs, after Router One has already tried other lines of the same model. The Reasoning Effort option appears only for model names that start with gpt-5, o1 or o3 and later, so it stays hidden for vendor-prefixed catalog IDs such as openai/gpt-5.5. To send it anyway, put {"reasoning_effort": "low"} in Extra Body, which n8n merges into the request body. Router One does not turn reasoning_effort into a thinking setting for Claude IDs, except on Claude Opus 5.5, where it maps the value to output_config.effort (none and minimal become low); other models may ignore it or reject the request with 400. If a 400 names temperature, top_p or another parameter, remove that option; it is the model rejecting the value, not the credential.

AI Agent and tool calling

The AI Agent node calls tools through the chat model connected to it, so pick an ID whose model page lists tool calling. If the gateway answers HTTP 400 with has no chat candidate that supports requested capabilities: tool_calling, the chosen ID cannot take tool calls; switch models. The OpenAI Chat Model node sends tool definitions without the strict flag. Each agent iteration is its own model request, so one execution can produce several entries in Dashboard → Logs: a model turn per tool call, plus the final answer. Keep the Use Responses API switch off unless every model the agent may use lists /v1/responses on its model page.

What the OpenAI node's actions call

The OpenAI node (default version 2.3) takes the same credential but calls fixed endpoints. Text → Message a Model posts to /v1/responses, so it works only with the GPT-family, DeepSeek and Grok chat IDs that endpoint serves; for Claude or Gemini IDs, use a Basic LLM Chain or an AI Agent with the OpenAI Chat Model sub-node and its Use Responses API switch off. Leave that action's background option off: Router One rejects background: true with 400, and the polling n8n does in that mode (GET /v1/responses/{id}) has no route on Router One either. Image → Generate an Image posts to /v1/images/generations, and its model search lists the catalog IDs that contain gpt-image, such as gpt-image-2; each image is billed at the flat per-image price on its model page. Audio, file and assistant actions call endpoints Router One does not serve, and return 404.

Embeddings and vector stores

The Embeddings OpenAI sub-node uses the credential's Base URL too, so with this credential it sends POST /v1/embeddings to Router One, which has no embeddings endpoint and returns 404. For vector store workflows, create a second OpenAI credential with OpenAI's own Base URL and key, or use another embeddings provider's node, and connect it to the vector store's embedding input. The chat model that answers from the retrieved text can still be the OpenAI Chat Model on the Router One credential.

Check an execution in Dashboard → Logs

Run the workflow once from the editor and open Dashboard → Logs. Each model call appears as its own request under the exact catalog ID, with tokens, cost, status, total time and, for a streamed request that produced output, time to first token (TTFT); an agent run shows one entry per model turn. Match them to n8n's execution view by time and model. A 401 means the key was not accepted; a 402 points at the wallet balance or the key's maxSpend. A 404 whose message asks for a base URL ending in /v1 means the credential's Base URL lacks it, and a 400 that names the endpoint to use means the Use Responses API switch does not fit the model.

Which model ID should n8n send?

Copy the exact model ID from /models, preserving case, hyphens, and version suffixes; do not substitute a display name. Open its detail page and match the supported API endpoints, context window, and capabilities such as tool calling to the provider and features selected in n8n. A catalog listing does not mean the client can use every feature of that model. Give each client or application a dedicated API key with a maxSpend cap.

Which API protocol is n8n using?

OpenAI-compatible describes an interface format; it does not make Chat Completions (/v1/chat/completions), Responses (/v1/responses), and Anthropic Messages (/v1/messages) interchangeable. Check the installed client version, provider configuration, and actual request path against the model detail page and API compatibility fact sheet. A successful plain-text chat does not establish support for hosted tools, conversation state, or file-editing features.

Verify the n8n call in your request trace

Send a simple text request from n8n, then match its trace in Dashboard → Logs by time, model, and request_id: tokens, cost, latency, and status. Next, test streaming, tool calls, and multi-turn history separately. For failures, retain the actual request path, full error message, and request_id. If there is no matching log, check client configuration and connectivity before attributing the error to the gateway or upstream.

FAQ

Which n8n nodes pick up this credential?

Every node that uses the OpenAI credential type: the OpenAI Chat Model sub-node that AI Agent and Basic LLM Chain connect to, the OpenAI node, and the Embeddings OpenAI sub-node. They call different endpoints. The chat model sends Responses or Chat Completions depending on its Use Responses API switch, the OpenAI node's Message a Model action always sends Responses, and embeddings have no endpoint on Router One, so a shared Base URL and key do not make every operation work. Check each node's operation against the model's page on /models.

Why does a Claude model return HTTP 400 from the OpenAI Chat Model node?

Because version 1.3 of the OpenAI Chat Model node, the current one in n8n 2.41.3, has a Use Responses API switch that is on by default, so the node sends POST /v1/responses. Router One serves that endpoint natively only for the currently listed GPT-family, DeepSeek and Grok IDs; a Claude-family ID is rejected with HTTP 400 invalid_request_error and the message model '<id>' must be called via /v1/messages or /v1/chat/completions, and Gemini IDs are not served there either. Turn Use Responses API off in the node and it sends Chat Completions, which serves every chat model in the catalog. Keep it on only for a model whose detail page lists POST /v1/responses; the node's Built-in Tools option is shown only while the switch is on.

The credential test fails. What should I check?

n8n tests the credential with GET {Base URL}/models. Base URL must be https://api.router.one/v1, with /v1 and nothing after it, and the key must be a valid Router One key; Router One answers the model list only when a valid key is sent. Leave Organization ID empty and Add Custom Header off.

Why does the model list include image models?

On a Base URL other than api.openai.com, the node lists every ID the endpoint returns, and Router One's list holds the whole catalog, image-generation models included. Those cannot answer a chat step; pick a chat model, or switch the Model field to ID and paste the exact chat ID from /models.

Why is the Reasoning Effort option missing?

The node shows it only when the model name starts with gpt-5, o1 or o3 and later, and catalog IDs carry a vendor prefix such as openai/. Put {"reasoning_effort": "low"} in Extra Body instead. Router One does not turn it into a thinking setting for Claude IDs, except on Claude Opus 5.5; other models may ignore it or reject the request with 400.

A long step fails after about a minute. Why?

The OpenAI Chat Model node's Timeout option defaults to 60,000 ms. Raise it for slow or reasoning-heavy models. Each retry after a failure (Max Retries defaults to 2) is a separate request in Dashboard → Logs.

Can vector store workflows use Router One?

For chat, yes; for embeddings, no. Router One has no embeddings endpoint, and the Embeddings OpenAI sub-node would call it through this credential and get 404. Give the embeddings node its own credential for a provider that serves embeddings, and keep the Router One credential on the chat model.

Which n8n version is this guide for?

n8n 2.41.3 (September 25, 2026), the npm latest and stable release, checked on 2026-09-29 against its source for the OpenAI credential, the OpenAI Chat Model node 1.3, the OpenAI node 2.3 and the Embeddings OpenAI node.

Which models can n8n use through the gateway?

Choose a current catalog model that supports both the endpoint and the features n8n uses. Check /models and the model detail page for the exact ID, current rates, and capabilities; a family name such as GPT or Claude is not a compatibility guarantee. A client that lists a model has only read the ID, from its own configuration or from GET /v1/models; verify an actual request too.

Models are listed, but requests fail with 400 or 404. What should I check?

Record the actual request path and error message, then check the exact model ID. A 400 can indicate invalid parameters, unsupported tools, or a model/endpoint mismatch; a 404 can indicate an incorrect path or missing resource, so it does not by itself establish that a model was retired. If the error says must be called via, use the named endpoint or select a model supported on the current endpoint. Do not add or remove /v1 or /chat/completions across all clients indiscriminately.

Does this work from Mainland China?

Yes. The gateway is reachable from Mainland China without a VPN, and the configuration is identical to the global setup.

How do I debug a 401/402/403/429?

Match the request and error message in Dashboard → Logs. For 401, check whether the key was sent and is valid; for 402, check wallet balance and maxSpend; for 403, check key permissions and access restrictions. For 429, distinguish request/token limits from upstream throttling using the error details. Keep the request_id and follow the error-codes reference.