Docs
n8n
n8n reaches a custom OpenAI-compatible API through the Base URL field on its OpenAI credential, not through the HTTP Request node and not through an option on the model node. Here is that credential for Kunavo, what each toggle sends, and one trap in the credential test that makes a wrong URL look right.
The OpenAI credential's Base URL field — https://api.kunavo.com/v1, keeping the /v1 — puts every OpenAI Chat Model in an n8n workflow on Kunavo; the model node itself has no endpoint field.
Credentials → Create credential → OpenAI
API Key sk-kn-...
Organization ID (optional) leave empty
Base URL https://api.kunavo.com/v1 <- keep the /v1
Workflow → AI Agent or Basic LLM Chain → Chat Model: OpenAI Chat Model
Credential to connect with the OpenAI credential above
Model ID mode: claude-sonnet-5
Use Responses API on → POST /v1/responses
off → POST /v1/chat/completionsGET {Base URL}/models and only looks at the status code. Leave off the /v1 and the test asks for https://api.kunavo.com/models — which is Kunavo's public model catalog page, so it answers 200 and n8n reports “Connection successful!” with any key at all. Run with /v1 and a wrong key, the same test correctly says “Unauthorized”. Both results were reproduced on n8n 2.41.4 on October 1, 2026.POST /v1/responses; switched off, it sends POST /v1/chat/completions. Kunavo serves every chat model on both routes, so either setting works; the toggle matters for the built-in tools below and for which request shape your logs show.api.kunavo.com with a deliberately invalid key to capture the errors a wrong setting produces. No completion, streamed reply or AI Agent tool call has yet been run against Kunavo with a working key.Step by step
- Create a key at
/app/keysand copy it — it is shown once. - In n8n, create a credential of type OpenAI. Put the key in API Key, leave Organization ID (optional) empty, and replace the Base URL default
https://api.openai.com/v1withhttps://api.kunavo.com/v1. Save. - Add an AI Agent or Basic LLM Chain node, and attach an OpenAI Chat Model sub-node using that credential. Switch the Model field from From List to ID and type the id the way
GET /v1/modelslists it, for exampleclaude-sonnet-5— the list works too, but a typed id keeps the workflow readable. - Decide on Use Responses API: leave it on unless a tool in your chain expects Chat Completions, or you want the n8n execution log to show a chat-completions request.
- Run the workflow once with a one-line prompt before wiring it to a trigger. A 401 means the key; a 404 whose message begins with
<!DOCTYPE html>means the Base URL lost its/v1.
Checked against n8n's OpenAI credential source at tag n8n@2.41.4 on October 1, 2026. Third-party settings move; if a field name here no longer matches what you see, that page is the authority, not this one.
Verify before you debug the client
One request settles whether a failure is the endpoint, the key, or the configuration file. If this returns JSON, the same base URL and key work in n8n.
# Settles whether a failure is the endpoint, the key, or the client.
curl -sS https://api.kunavo.com/v1/models \
-H "Authorization: Bearer sk-kn-..."Which model id to put in the field
Every text model is reachable as a model id — the live list is GET /v1/models, and the catalog with prices is on the models page. Rates are USD per 1M tokens, input / output.
| Model id | Kunavo in / out | Where it fits in n8n |
|---|---|---|
claude-sonnet-5 | $1.40 / $7.00 | AI Agent nodes that call tools and have to pick the right one |
claude-haiku-4-5 | $0.70 / $3.50 | Per-item classification, extraction and routing inside a loop — where volume sets the bill |
claude-opus-5 | $3.50 / $17.50 | A single planning or review step where a wrong answer costs a whole run |
Why the Base URL is on the credential
Older tutorials set the endpoint inside the model node. In the released source that in-node Base URL option is hidden from node version 1.1 onward, so a node you add today has no such field and the credential's Base URL is the one that counts. n8n's own OpenAI Chat Model documentation and its credential page do not describe the field; the source does, with the description “Override the default base URL for the API”. The HTTP Request node is a different route entirely — it works, but you would be hand-building the request an AI Agent node builds for you.
Responses API on or off
- On (the default on node 1.3) — requests go to
/v1/responses. This is the only mode that shows the node's Built-in Tools — Web Search, File Search and Code Interpreter. Those are OpenAI-hosted tools; nobody has tested them through Kunavo, so do not build a workflow that depends on them without trying it first. - Off — requests go to
/v1/chat/completions, the most widely supported shape, and the one to fall back to if a tool call misbehaves under the other. - Tools you attach to an AI Agent are sent to the model as function definitions. That round trip was not part of this check, so run one tool call on a test workflow before relying on it.
n8n and OpenRouter
n8n ships a separate OpenRouter Chat Model node with its own OpenRouter credential. That credential has an API Key field and a Base URL that is hidden and fixed at https://openrouter.ai/api/v1, and its test calls OpenRouter's own /key route — so the OpenRouter node can only ever talk to OpenRouter. If OpenRouter is what you want, use that node with an OpenRouter key; nothing on this page is needed.
Any other OpenAI-compatible endpoint, Kunavo included, goes through the OpenAI Chat Model and the OpenAI credential's Base URL as above. Choose between them on what actually differs — which models you need, how you want to pay, whether you want one balance across n8n and your other tools — not on the node. Kunavo's side of that comparison is in Kunavo vs OpenRouter.
Keeping an unattended workflow's bill bounded
- The node's Max Retries defaults to 2 and Timeout to 60000 ms. A request that times out is retried, and a retry is a new billed request.
- Set Maximum Number of Tokens on nodes that run per item — a loop over 1,000 rows multiplies whatever one call costs.
- Use a separate Kunavo key for each production workflow so the usage page shows which one spent what, and revoke one without touching the others.
What the errors look like
- “401 Missing or invalid API key” — the Base URL is right and the key is not. Reproduced on 2.41.4.
- “404 <!DOCTYPE html>…”, filed by LangChain under MODEL_NOT_FOUND — misleading: the model is fine, the Base URL is missing
/v1and the request landed on the website. Reproduced on 2.41.4. - A model-not-available message in JSON — the model ID does not match
GET /v1/modelsexactly.
FAQ
How do I use a custom OpenAI-compatible API in n8n?
Create an OpenAI credential and change its Base URL from https://api.openai.com/v1 to your endpoint's OpenAI-compatible root, keeping the /v1 — for Kunavo, https://api.kunavo.com/v1 — with your key in API Key. Then use the OpenAI Chat Model sub-node under an AI Agent or Basic LLM Chain, select that credential and enter the model by ID. The field is in n8n's released source (credential OpenAiApi, n8n@2.41.4) even though n8n's credential documentation page lists only API Key and Organization ID.
Why does n8n say Connection successful but the workflow fails with a 404?
Because the credential test only checks that GET {Base URL}/models returns a success status. If the Base URL is missing /v1, the test requests a /models path on the bare host; on Kunavo that is the public model catalog web page, which returns 200, so n8n reports success with any key. The workflow then sends its request to a path that does not exist and fails with a 404 whose message is an HTML page. Add /v1 to the Base URL. Reproduced with n8n 2.41.4 on October 1, 2026.
Should Use Responses API be on or off for a custom endpoint?
Either works if the endpoint serves both routes, as Kunavo does for every chat model. On node version 1.3 it defaults to on and sends POST /v1/responses; off sends POST /v1/chat/completions, which was confirmed by running both settings on n8n 2.41.4. Turn it off if a tool call or output format misbehaves, since chat completions is the more widely supported shape. The Built-in Tools list (web search, file search, code interpreter) only appears with it on, and those are OpenAI-hosted tools that have not been tested through Kunavo.
Can I point n8n's OpenRouter node at another endpoint?
No. The OpenRouter credential's Base URL is a hidden field fixed to https://openrouter.ai/api/v1 and its test calls OpenRouter's own /key route, so the OpenRouter Chat Model node only talks to OpenRouter. For any other OpenAI-compatible endpoint use the OpenAI Chat Model with an OpenAI credential whose Base URL you change.
Has Kunavo tested n8n?
Partly. n8n 2.41.4's official Docker image was run on October 1, 2026 against a local mock endpoint to confirm which paths each setting sends, and against the real Kunavo API with an invalid key to confirm the credential-test and workflow errors described here. No successful completion, streamed reply or AI Agent tool call has been run against Kunavo with a working key yet, so treat your own first run as the end-to-end check.