Guide

Free LLM API for n8n

n8n is a workflow automation tool with AI nodes. Its OpenAI credential has a Base URL field, so you can send the requests to any OpenAI-compatible API. This guide points that field at FreeLLMAPI. FreeLLMAPI pools 45 free provider tiers behind one key and moves to the next provider when a limit stops a request.

What you need

  • n8n, self-hosted or on n8n Cloud. A cloud instance cannot reach localhost on your computer. For n8n Cloud, FreeLLMAPI must have a public HTTPS address.
  • FreeLLMAPI, installed with Docker or the desktop app. Add at least two free provider keys on the Keys page.
  • The unified key from the FreeLLMAPI Keys page. n8n uses only this key.

Install FreeLLMAPI (macOS or Linux)

curl -fsSL https://freellmapi.co/install.sh | bash

The Base URL depends on where n8n runs. Inside a Docker container, localhost is the container, not your computer.

n8n runsBase URL
On the host (npm or npx)http://localhost:3001/v1
In Docker Desktop (macOS, Windows)http://host.docker.internal:3001/v1
In Docker on Linux, same host as FreeLLMAPIhttp://freellmapi:3001/v1, after you connect the n8n container to the FreeLLMAPI Docker network
n8n CloudThe public HTTPS address of your FreeLLMAPI server, with /v1 at the end

Step 1: Create the OpenAI credential

  1. In n8n, open Credentials and create a new credential of the type OpenAI.
  2. In API Key, paste your FreeLLMAPI unified key.
  3. Leave Organization ID (optional) empty.
  4. In Base URL, replace https://api.openai.com/v1 with your FreeLLMAPI URL, for example http://host.docker.internal:3001/v1.
  5. Save the credential.

All OpenAI nodes that use this credential now send their requests to FreeLLMAPI. Your real provider keys stay in FreeLLMAPI. They do not go into n8n.

Test the URL from the n8n container

docker exec n8n wget -qO- \
  --header="Authorization: Bearer <unified-key>" \
  http://host.docker.internal:3001/v1/models | head -c 300

Step 2: Build an AI Agent workflow

The AI Agent node needs a chat model sub-node and at least one tool sub-node. Since n8n 1.82.0, every AI Agent node works as a Tools Agent. The agent sends tool definitions to the model, so the model must support tool calling.

  1. Add a Chat Trigger node. It gives you a chat window to test the workflow.
  2. Add an AI Agent node after the trigger.
  3. Connect an OpenAI Chat Model sub-node to the Chat Model input of the agent. Select your FreeLLMAPI credential.
  4. In Model, change the mode from From List to ID. Type auto.
  5. Connect a tool sub-node, for example the Calculator tool or an HTTP Request tool.
  6. Open the chat and send a test message.

Use ID mode for the model. The list mode shows the full FreeLLMAPI catalog, which also contains models that you cannot call yet. These IDs are useful in n8n:

Model IDUse it for
autoGeneral workflows. The router follows your fallback chain.
auto:fastClassification, short summaries and other high-volume steps
auto:smartAgent steps that must plan or select tools
auto:reliableScheduled workflows that must not fail
auto:<profile>A named fallback chain, for example one that has only tool-calling models

For agent steps, keep only tool-calling models in the chain. These free models support tool calling today:

Free models with tool calling and 128K+ context
ModelFree onContextFree limits (best offer)ToolsVision
GLM 5.3UnoRouter1M1 req/min
1 req/min per model
YesNo
GLM 5.3 FlashNVIDIA NIM, UnoRouter1M40 req/min
40 RPM
YesYes
Gemini 3.8 FlashGoogle AI Studio1MRecurring provider quotaYesYes
Qwen3.8 Flash NextAMD Radeon Cloud262KRecurring daily account allowanceYesNo
Qwen3.8 FlashElectronHub1M$0.25/week shared recurring creditYesYes
Gemini 3.7 FlashGoogle AI Studio1M10 req/min
20 req/day
250,000 tokens/min
~3M
YesYes
GPT-5.6 LunaElectronHub1M$0.25/week shared recurring creditYesYes
Dots3 Note PreviewKilo Gateway, OpenRouter512K20 req/min
50 req/day
50 req/day account-wide (1,000 after a $10 purchase)
YesYes
DeepSeek V4 FlashAMD Radeon Cloud, BazaarLink, ElectronHub1M10 req/min
50 req/day
Shared rate limit
YesNo
Qwen3.8 27BElectronHub, Groq, OVH AI Endpoints262K30 req/min
250 req/day
70,000 tokens/min
~6M
YesYes

Showing 10 of 109 matching free models. See all models.

Live data from the FreeLLMAPI catalog (version 2026.11.19, checked 19 November 2026). Free limits change often. The catalog is checked every day.

Use Responses API: keep this option off on the OpenAI Chat Model node. The built-in tools behind it (Web Search, File Search, Code Interpreter) are OpenAI services. The FreeLLMAPI docs do not describe support for them. Use n8n tool sub-nodes for these tasks.

Step 3: Handle free-tier limits

A workflow that loops over 500 items sends 500 requests. Free tiers limit requests per minute and per day. FreeLLMAPI counts the quota of each key and moves to the next provider on a 429 error. When every key in the chain is at its limit, the gateway returns 429 with a Retry-After header.

Set these options so that a short limit does not stop the workflow:

WhereSettingValue
OpenAI Chat Model, OptionsMax Retries3 to 5
OpenAI Chat Model, OptionsTimeout60000 ms or more for long prompts
Node settings (gear icon)Retry On FailOn
Node settingsMax. Tries3
Node settingsWait Between Tries (ms)5000 or more
Loop Over Items nodeBatch SizeSmall batches, with a Wait node between them

Add keys from more providers to raise the total number of requests per day. The table shows the free limits per provider in today's catalog.

ProviderFree modelsMax req/minMax req/dayMax tokens/minTokens/month (one model)Strongest free model
ElectronHub84---$0.25/week shared recurring creditQwen3.8 Flash (ElectronHub)
qwen3.8-flash
Cloudflare Workers AI39---~5-10MQwen 3.8 27B (Cloudflare Workers AI)
@cf/qwen/qwen3.8-27b
Inferbase38---5,000 requests/month; 100 requests and $0.50 usage/day sharedDeepSeek V4 Flash (fp8) (Inferbase)
deepseek-v4-flash:fp8
AI Horde31---Ongoing volunteer queue; availability variesGemma 4 31B Heretic (AI Horde)
koboldcpp/gemma-4-31B-it-heretic
ACLIDE29---€20/month shared internal usage credits · no cardQwen3.8 Max (ACLIDE)
qwen/qwen3.8-max:free
Google AI Studio21151,000250,000~3MGemini 3.8 Flash
gemini-3.8-flash
Api.Airforce2011,000-free · 1,000 req/day · 1 req/mingpt-oss-20b (Api.Airforce)
gpt-oss-20b
NVIDIA NIM1940--free · 40 RPMGLM 5.3 Flash (NV)
z-ai/glm-5.3-flash
Cohere172033-~1-2MCommand A+ (05-2026)
command-a-plus-05-2026
DreamPrompting141005,000-free · 500K tokens/day · 5,000 req/dayGemini 3.1 Flash-Lite
google/gemini-3.1-flash-lite

Live data from the FreeLLMAPI catalog (version 2026.11.19, checked 19 November 2026). Free limits change often. The catalog is checked every day.

Use the HTTP Request node

You can also call FreeLLMAPI with the generic HTTP Request node. Use this method when you need a parameter that the OpenAI node does not show, or when you want the response headers.

  • Method: POST
  • URL: http://host.docker.internal:3001/v1/chat/completions
  • Header: Authorization with the value Bearer <unified-key>
  • Body content type: JSON

JSON body

{
  "model": "auto:fast",
  "messages": [
    {"role": "system", "content": "Classify the ticket as billing, bug or other. Reply with one word."},
    {"role": "user", "content": "{{ $json.ticket_text }}"}
  ],
  "temperature": 0
}

The answer is in choices[0].message.content. The response header X-Routed-Via shows the provider and model that answered. If the router changed provider, X-Fallback-Attempts shows the number of failed attempts.

Troubleshooting

ProblemCauseFix
Credential test fails with a connection errorlocalhost points to the n8n containerUse host.docker.internal or a shared Docker network
Error 401Wrong keyPaste the unified key again
The model list has hundreds of entriesList mode reads the full catalogUse ID mode and type auto
The agent answers but never uses a toolThe selected model does not support tool callingUse a model from the table above, or a profile with tool-calling models
Error 429 in a long loopAll keys are at their limitAdd providers, use smaller batches and turn on Retry On Fail
The node times outA slow free model with a long promptIncrease Timeout, or use auto:fast
Use every one of these through one key. FreeLLMAPI is an open-source, self-hosted router that puts all these free tiers behind a single OpenAI-compatible endpoint and fails over when one is rate-limited. Browse the catalog or go live.

Frequently asked questions

Can I use a custom base URL with the n8n OpenAI node?

Yes. The OpenAI credential in n8n has a Base URL field. Set it to an OpenAI-compatible URL that ends in /v1, for example http://localhost:3001/v1 for FreeLLMAPI.

Is there a free LLM API for n8n?

Yes. Free provider tiers work in n8n through the OpenAI credential. FreeLLMAPI combines many free tiers behind one key. Each tier has its own request limits.

Which free model works with the n8n AI Agent node?

Use a model that supports tool calling, because the AI Agent node works as a Tools Agent. The table on this page lists free models with tool calling.

How do I stop n8n workflows from failing on rate limits?

Set Max Retries on the chat model node, turn on Retry On Fail in the node settings and process items in small batches. Add keys from more providers to raise the daily total.

Does n8n Cloud work with a self-hosted LLM gateway?

Only if the gateway has a public HTTPS address. n8n Cloud cannot reach localhost on your computer.

Sources

All guides · Browse all free models

Keep reading

All posts →
Guide

Best free LLM APIs 2026

Ten genuinely free LLM APIs worth using — ranked, with real limits.

Guide

Unlimited free AI tokens?

No free AI API is unlimited. The closest real thing: 10.1 billion free tokens a month behind one key.

Guide

How to get a free LLM API key

Get a working key in minutes — no credit card required.