Models → Pricing → Docs → Blog → Changelog → Contact → Status →
Get started freeLog in

n8n

Call FreeModel models from n8n workflows, either through n8n's OpenAI nodes or a plain HTTP request.

⏱ 4 min read

Overview

n8n is a workflow automation tool. There are two ways to use FreeModel in it:

  • OpenAI credential with a custom base URL, used by n8n's OpenAI nodes, including the OpenAI Chat Model node that AI Agent and chain nodes need.
  • HTTP Request node that calls https://freemodel.in/v1/chat/completions directly. This works in any n8n version and gives you the raw JSON.

Prerequisites

  • An n8n instance (self-hosted or cloud) where you can create credentials.
  • A FreeModel key from Dashboard → API Keys. Create a separate key for n8n so you can revoke it on its own.
  • Free accounts: free models only, such as gpt-6-luna. Claude Haiku 5.5 and GPT-6.2 Astra are on the free plan; the other Claude models and premium models need a paid plan.

Option 1: OpenAI credential

  1. In n8n, create a new credential of type OpenAI.
  2. API Key → your fm_… key.
  3. Base URL → https://freemodel.in/v1. Leave any organization field empty.
  4. Save. n8n tests the credential against the base URL.
  5. Add an OpenAI Chat Model node (for example under an AI Agent or Basic LLM Chain node) and select this credential.
  6. Set the model to a FreeModel id such as gpt-6-luna.

The model list in the node is filled from GET /v1/models. If the id you want is not shown, switch the model field to enter an id (or an expression) and type it exactly. If your n8n version has no Base URL field on the OpenAI credential, update n8n or use Option 2.

For AI Agent workflows that use tools, pick a model with the Tools capability on Models.

Option 2: HTTP Request node

Create a Header Auth credential with name Authorization and value Bearer fm_your_key_here. Then configure an HTTP Request node:

FieldValue
MethodPOST
URLhttps://freemodel.in/v1/chat/completions
AuthenticationGeneric credential type → Header Auth (the credential above)
Send Bodyon, content type JSON

Body, using an expression for text from the previous node:

{
  "model": "gpt-6-luna",
  "messages": [
    {"role": "system", "content": "Summarise the text in two sentences."},
    {"role": "user", "content": "{{ $json.text }}"}
  ]
}

The answer is in choices[0].message.content of the node output, and token use is in usage. If the incoming text can contain quotes or line breaks, build the body with an expression that serialises it as JSON, so the request stays valid.

Test the connection

Before building the workflow, check the key from a terminal:

curl https://freemodel.in/v1/chat/completions \
  -H "Authorization: Bearer fm_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-6-luna", "messages": [{"role": "user", "content": "Reply with the word ok."}]}'

In n8n, run the single node with Execute step and look at its output panel.

Which model ids to use

AccountIds
Freegpt-6-luna; other free models: GPT-6.2 Astra, GPT-6 Luna, Grok 4.6, Grok 4.7, Claude Haiku 5.5, GLM-5.3 Flash, Qwen 3.8 Omni Flash and DeepSeek V4.1 Flash 1017.
PaidAny id on Models. For high-volume steps such as classification, a 1× or 1.5× model like claude-haiku-5.5 (1.5×) uses fewer plan tokens than a 3× or 4× model.

Scheduled workflows run without you watching. Remember that input and output tokens both count, and a free account is limited to 400K tokens per minute.

Common errors and fixes

StatusWhat it meansFix
401Key wrong or missing. In Header Auth, the value must start with Bearer (with a space).Re-enter the credential.
403 upgrade_requiredFree account, paid model.Pick a free model, or buy a plan.
404 model_not_foundModel id not listed — often a default like gpt-4o left in the node.Set the model field explicitly. Unlisted names are not mapped to other models.
402Tokens used up (tokens_exhausted).Renew or upgrade. Refused requests are not charged.
429Plan requests-per-minute limit, common in loops over many items.Use batching or a Wait node between calls; a larger plan raises the limit.

Turn on the node's retry-on-fail setting for 429 and 503, which are temporary. Do not retry 401, 402, 403 or 404; they need a settings change.

Was this page helpful?
Still stuck?
Open a support ticket from your dashboard or message our support bot on Telegram.
Telegram supportGet help