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

Setup

  1. In n8n, go to CredentialsAdd CredentialOpenAI API.
  2. Fill in:
FieldValue
NameXantly
API Keyxantly_sk_...
Base URLhttps://api.xantly.com/v1
Organization ID(leave blank)
  1. 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

  1. Add an OpenAI Chat Model node.
  2. Under Credential for OpenAI API, pick Xantly.
  3. Set Model to xantly/auto-quality (or any catalog slug).
  4. 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:

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:

FieldValue
MethodPOST
URLhttps://api.xantly.com/v1/chat/completions
AuthenticationHeader Auth
Header NameAuthorization
Header ValueBearer xantly_sk_...
BodyJSON: { "model": "xantly/auto-quality", "messages": [...] }

Model choice

Model IDWhen
xantly/auto-qualityAI Agent, reasoning nodes.
xantly/auto-valueHigh-volume workflow nodes (classifiers, summarizers).
xantly/auto-speedSimple text transforms, triggered frequently.
anthropic/claude-sonnet-4.6Tool-calling AI Agent.
openai/text-embedding-3-smallVector Store embeddings.

Verify

  1. Create a Manual Trigger → OpenAI Chat Model (Xantly credential, xantly/auto-speed).
  2. Input: "say pong".
  3. Execute the workflow.
  4. Check your Xantly dashboard, the call logs with cost + model.

What you get

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