Use Xantly with n8n
n8n's OpenAI Chat Model node accepts a custom base URL. Every workflow that touches LLMs, AI Agent, RAG, HTTP Request, routes through Xantly for BaRP routing, cache, and budget caps.
n8n is the open-source workflow automation tool, connect services, trigger on events, run AI inside workflows. Its OpenAI Chat Model node accepts a custom base URL, so pointing it at Xantly gives every workflow BaRP routing, semantic cache, and memory. The AI Agent node (LangChain under the hood) also picks up the same config.
Prerequisites
- n8n running (self-hosted, cloud, or desktop)
- A Xantly API key, create one
Setup
- In n8n, go to Credentials → Add Credential → OpenAI API.
- Fill in:
| Field | Value |
|---|---|
| Name | Xantly |
| API Key | xantly_sk_... |
| Base URL | https://api.xantly.com/v1 |
| Organization ID | (leave blank) |
- Click Save.
Now every node that uses the OpenAI credential, OpenAI Chat Model, AI Agent, Chain LLM, OpenAI: routes through Xantly.
Simple Chat Model node
- Add an OpenAI Chat Model node.
- Under Credential for OpenAI API, pick
Xantly. - Set Model to
xantly/auto-quality(or any catalog slug). - Wire up input messages.
Run the workflow, Xantly logs the call with routing + cost.
AI Agent (LangChain) node
The AI Agent node is a LangChain agent under the hood. Configure the OpenAI Chat Model sub-node with the Xantly credential; agent runs route through Xantly too.
For tool-heavy agents (HTTP Request tools, Google Search tools), use anthropic/claude-sonnet-4.6 as the agent's model, it's the most reliable tool-caller.
RAG with Vector Store nodes
n8n ships Pinecone, Qdrant, Supabase Vector nodes. Pair them with:
- OpenAI Embeddings node → pick your Xantly credential + model
openai/text-embedding-3-small. - OpenAI Chat Model node for the retrieval step →
xantly/auto-quality.
The full RAG pipeline runs through Xantly, embedding + query both benefit from semantic cache and smart routing.
HTTP Request node (advanced)
If a specific node doesn't expose base URL config (rare but possible), hit Xantly directly via HTTP Request:
| Field | Value |
|---|---|
| Method | POST |
| URL | https://api.xantly.com/v1/chat/completions |
| Authentication | Header Auth |
| Header Name | Authorization |
| Header Value | Bearer xantly_sk_... |
| Body | JSON: { "model": "xantly/auto-quality", "messages": [...] } |
Model choice
| Model ID | When |
|---|---|
xantly/auto-quality | AI Agent, reasoning nodes. |
xantly/auto-value | High-volume workflow nodes (classifiers, summarizers). |
xantly/auto-speed | Simple text transforms, triggered frequently. |
anthropic/claude-sonnet-4.6 | Tool-calling AI Agent. |
openai/text-embedding-3-small | Vector Store embeddings. |
Verify
- Create a Manual Trigger → OpenAI Chat Model (Xantly credential,
xantly/auto-speed). - Input:
"say pong". - Execute the workflow.
- Check your Xantly dashboard, the call logs with cost + model.
What you get
- Workflow-scale cache savings. n8n often runs the same workflow thousands of times on different triggers. Same-prompt-shape semantic matches → massive cache hit rate.
- Waterfall fallback. A provider outage mid-workflow doesn't kill the execution, Xantly silently retries.
- Memory across runs. Set
X-Xantly-Memory-Mode: recallas a custom header via the HTTP Request node, or inside a credential's extra headers config. - Cost tracking per workflow. Create a separate Xantly API key per workflow (
n8n-leadqualifier,n8n-supporttriage) and see per-workflow spend in the Xantly dashboard. - Budget caps per workflow: each key has its own daily USD budget.
Gotchas
Base URL field not always visible. Some older n8n versions hide this field. Upgrade to 1.50.0+ where it's prominent in the OpenAI credential form.
/v1 suffix required.
LangChain-based AI Agent node. It's built on LangChain.js, so the underlying LLM config matches LangChain TS. Same constraints apply.
Tool-call reliability. If the AI Agent's tools fire then hang (no follow-up response), swap the model from generic to anthropic/claude-sonnet-4.6, stronger tool-calling.
Self-hosted vs cloud. Both work identically. Cloud n8n doesn't restrict custom base URLs.
Next steps
- Zapier (OpenAI connector), the other big no-code automation tool.
- LangChain TypeScript, the engine behind n8n's AI Agent.
- OpenAI SDK (TypeScript), if you build custom n8n nodes.
- Cost-Optimized Routing, critical for automated workflows at scale.