n8n
Last updated
n8n's built-in OpenAI credential is built for OpenAI's own models. Point its base URL at Tempr Gateway and that same credential (the one your workflows already use) can call Claude, Gemini, DeepSeek, or anything else on your allowlist, with no separate credential type per provider.
n8n's "OpenAI" credential is normally exactly that: OpenAI only. Once it points at Tempr, the model field on each node becomes the only thing that decides which provider actually runs, so one workflow can mix models from different providers across its nodes without juggling multiple credential types.
-
Create a virtual key
In the Portal, create a Gateway virtual key. Keys are prefixed
tvk_and shown once at creation. -
Add a provider key
Gateway is BYOK: add a key for at least one provider from the supported list.
-
Add an OpenAI credential in n8n
Go to Settings → Credentials → Add Credential → OpenAI. Set:
- API Key: your virtual key
- Base URL:
https://api.temprhq.io/v1 - Organization ID: leave blank
-
Use it in a workflow
Add an AI Agent node with a Chat Model edge using this credential, and set the model field to any id from your allowlist:
anthropic/claude-sonnet-4-5,google/gemini-3.1-pro-preview, whatever the workflow needs, not just an OpenAI model. Each needs a key for its provider in the Portal (Anthropic, Google); or use any model fromGET /v1/models.
New OpenAI Chat Model nodes use OpenAI's Responses API (Use Responses API, on by default), and Tempr serves it for every model: OpenAI's own models pass straight through, and the rest are translated. The node's Built-in Tools (Web Search, File Search, Code Interpreter) run only on OpenAI models (openai/…); on any other model Tempr leaves them out and the rest of the request still runs. Turn Use Responses API off to use Chat Completions instead. Either way, the AI Agent's own tools work on every model.
Embeddings
The same credential serves n8n's Embeddings OpenAI node, for a vector store or RAG workflow: add the node, pick the Tempr credential, and set the model to an embedding model Tempr serves, such as openai/text-embedding-3-small, google/gemini-embedding-001 or cohere/embed-v4.0. Use the same embedding model to insert documents and to query them.
On a coding plan
Tempr serves each coding plan only to the tools its vendor allows, and recognises a tool by the identity it sends. n8n is a workflow app, not a coding tool, and sends a generic identity, so Tempr can't tell it from a script, and a plan limited to the tools its vendor names, or to coding tools Tempr recognises (Z.AI, Kimi, Alibaba, Tencent, KUAE and others), refuses it with a plan_tool_not_allowed error. n8n can use the plans that accept any tool: MiniMax, StepFun, Synthetic, Ollama Cloud, NanoGPT, Fire Pass and ClinePass. Name the model by the plan: minimax-plan/MiniMax-M3.1-Flash-Preview. Tempr can get the plan's key two ways:
- Stored in Tempr. Add the plan's key under Provider keys in the Portal, and keep n8n's settings as they are, with your virtual key.
- Sent with each request. In the OpenAI credential, put the plan's key in API Key, then use Add Custom Header: the name
x-tempr-key, with your virtual key as the value. In the OpenAI Chat Model node, pick the model by ID, asminimax-plan/MiniMax-M3.1-Flash-Preview. Tempr sends the plan's key only to that plan, and never stores it. An organization's keys take a key sent this way once an owner or admin turns on Plan logins.
Several plans are sold only for the coding tools they support, and some refuse other tools, telling them apart by the identity each tool sends. Tempr passes n8n's own along and never sends another, so check which tools each plan supports before you subscribe.
Let a workflow read your Gateway
An AI Agent node can also read your Gateway through the Gateway's own MCP server: usage and cost, request logs and one request's routing, keys, plan, and providers cooling down. A scheduled workflow can post yesterday's spend by key to Slack, or check the error rate after a deploy. It comes with the Gateway Pro, Scale and Enterprise plans.
-
Create a management key
In the Portal, under Gateway → Keys → Management keys (or Organization → Org keys for an organization's Gateway). A management key reads and manages the Gateway but can't call models, so it's separate from the
tvk_virtual key in your OpenAI credential. Tick Read usage, Read request logs and List keys. -
Add an MCP Client Tool
On the AI Agent node, add the MCP Client Tool as a tool. Set Endpoint to
https://api.temprhq.io/mcp/adminand Server Transport to HTTP Streamable. -
Give it the key
Set Authentication to Bearer Auth and create a credential with the management key as the token: just
tmk_..., since n8n addsBeareritself. To sign in to Tempr instead, choose MCP OAuth2; signed in this way, the workflow reads your own Gateway, or your organization's if you're an owner or admin.
- The key's permissions decide the tools. Without Read request logs, the agent gets the usage, plan and key tools but not the logs.
- Keep it read-only. An agent in a workflow calls tools without asking anyone, so leave Create, change and revoke keys unticked unless the workflow is meant to change keys. That also needs Key changes by AI agents turned on, on the Portal's MCP connectors page.
What's next
- The Gateway's MCP server: every tool, what it returns, and how text from your apps is marked.
- Authentication & virtual keys: scoping keys with model allowlists, budgets, and rate limits.
- Embeddings: the providers and models the Embeddings OpenAI node can use.
- Models, limits & logs: request logs and analytics for everything you send through the gateway.