Every automation builder hits the same wall eventually: you wire up an AI node, pick GPT-4, and three months later you realize that every simple email summary and ticket classification is burning premium tokens. Your n8n instance is doing incredible work — routing data, triggering actions, orchestrating entire business processes — but the AI step is a blunt instrument. One model for everything, no fallback when it goes down, and a cost curve that only goes up.
This is exactly the problem Antbase was built to solve. When you point n8n at Antbase instead of directly at OpenAI, every AI call in your workflows gets classified and routed to the optimal model automatically. That email summarization step? It goes to a fast, free model like Llama 3.3 70B. The complex customer sentiment analysis? That gets escalated to GPT-4o or Claude. And if one provider goes down at 3 AM, Antbase fails over to another — your automations keep running.
The combination is powerful because n8n already thinks in terms of workflows and conditional logic, and Antbase adds that same intelligence to the AI layer. You stop worrying about which model to hardcode into each node and start building automations that are both smarter and cheaper. Most teams see 60-80% cost reduction on their AI-powered workflows without changing a single prompt.
n8n is an open-source workflow automation platform. By pointing its HTTP Request or OpenAI nodes at Antbase, every AI call in your automations gets routed to the optimal model — cheaper models for simple tasks, premium models for complex ones.
Quick Setup
The fastest way is to use the built-in OpenAI node with a custom base URL. In n8n, go to Credentials and create a new OpenAI credential:
- •API Key: your Antbase API key (ant_...)
- •Base URL: https://antbase.ai/v1
That credential now works with any OpenAI-compatible node — Chat, Completion, or Embedding. n8n sends requests to Antbase, which classifies and routes them.
Using the HTTP Request Node
For more control, use the HTTP Request node directly. This lets you set custom headers, pass metadata, and handle streaming responses:
{
"method": "POST",
"url": "https://antbase.ai/v1/chat/completions",
"headers": {
"Authorization": "Bearer {{ $credentials.antbaseApiKey }}",
"Content-Type": "application/json"
},
"body": {
"model": "auto",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "{{ $json.input }}"
}
]
}
}Example: Email Summarization Workflow
A practical workflow: trigger on new emails, summarize them with AI, and post to Slack. The summarization step is a simple task, so Antbase routes it to a fast free model instead of GPT-4o.
Email Trigger → HTTP Request (Antbase) → Slack Message
↓
model: "auto"
Antbase routes to Llama 3.3 70B (free, fast)
instead of GPT-4o ($2.50/1M tokens)Tips
- •Set timeout to 60s on the HTTP Request node — some complex routes take longer when Antbase escalates to premium models.
- •Use model: "auto" to let Antbase decide. Use a specific model name (e.g., "gpt-4o") to pin routing when you need deterministic output.
- •For streaming responses, enable "Response Format: Stream" in the HTTP node settings.
- •n8n retries on 5xx errors by default. Antbase has its own retry logic with circuit breakers, so set n8n retries to 1 to avoid duplicate requests.
With this setup, every AI node in your n8n workflows benefits from intelligent routing — lower costs on simple automations, premium models only when the task demands it.



