Skip to content
RU

n8n

Connect n8n to Mixen — pay from your balance in roubles, with a catalog of 105+ models.

n8n is a low-code automation platform. Options: n8n Cloud or self-hosted via Docker:

Terminal window
docker volume create n8n_data
docker run -it --rm --name n8n -p 5678:5678 \
-e GENERIC_TIMEZONE="Europe/Moscow" -e TZ="Europe/Moscow" \
-v n8n_data:/home/node/.n8n \
n8nio/n8n

The UI opens at http://localhost:5678.

n8n nodes (OpenAI, OpenAI Chat Model) share the “OpenAI” credential, and its form has a Base URL field — that’s what we override:

  1. Add an OpenAI Chat Model node (for AI Agent chains) or an OpenAI node (for plain requests) to your workflow.
  2. In Credential to connect with, click Create new credential.
  3. Fill in:
API Key: your-api-key
Base URL: https://api.mixen.ai/v1

Leave Organization ID empty. A key starting with mxn-… is issued in the dashboard.

  1. Save — n8n verifies the credential with a GET /models request against the Base URL, i.e. against the Mixen catalog.
  2. In the node’s Model parameter, pick a model from the list — n8n loads it dynamically from your endpoint, so you’ll see the entire Mixen catalog.

If the OpenAI node in your build hits the OpenAI domain directly (older versions without the Base URL field), use a plain HTTP Request node — a complete working example follows.

Scenario: trigger → model request → parsing

Section titled “Scenario: trigger → model request → parsing”

A workflow on the HTTP Request node: it doesn’t depend on the OpenAI node version and shows everything that goes to the API. Four nodes:

Manual Trigger → Edit Fields (Set) → HTTP Request → Edit Fields (Set)
(start) (build prompt) (call Mixen) (extract answer)

1. Manual Trigger. A trigger fired by the Execute Workflow button — handy for debugging the chain. In production, replace it with a schedule trigger, a webhook, or a data-source event.

2. Edit Fields (Set) — the prompt. Mode Manual Mapping, one field in Fields to Set:

Name: prompt
Value: Colombia Supremo coffee, medium roast, 250 g, notes of caramel and citrus

The prompt text here is arbitrary. If it is assembled from previous nodes’ data, switch the value into expression mode and reference the field: {{ $json.product_name }} — this is how the node consumes data from triggers, CRMs, and spreadsheets.

3. HTTP Request — the Mixen call. Node parameters:

Parameter Value
Method POST
URL https://api.mixen.ai/v1/chat/completions
Send Headers Using Fields Below
Header: Name / Value Authorization / Bearer your-api-key
Send Body Body Content Type: JSON → Using JSON

The body in JSON mode:

{
"model": "z-ai/glm-5.3-flash",
"messages": [
{
"role": "system",
"content": "You are a copywriter for an online store. Write product descriptions of 2-3 sentences, no fluff and no exclamation marks."
},
{ "role": "user", "content": "{{ $json.prompt }}" }
]
}

The key can also live in a credential: Authentication → Generic Credential TypeHeader Auth (Name Authorization, Value Bearer your-api-key) — then the token isn’t stored in node parameters.

4. Edit Fields (Set) — parsing the response. One more such node, Manual Mapping:

Name: answer
Value: {{ $json.choices[0].message.content }}

The response arrives in OpenAI’s format, so the path to the text is always the same. From here the answer can flow into Telegram, an email, a spreadsheet — wherever your automation was heading.

Two notes on the request body:

  • Keep the system message constant: a repeating prefix lands in the prompt cache, and input on repeats is billed at ~10% of the price (see the economics section).
  • reasoning_effort (off, low, medium, high, xhigh, max) is added as the same JSON field — a low depth saves noticeably in bulk automations. Supported levels per model are in GET /v1/models, field capabilities.reasoning_efforts.

For agent chains take the AI Agent node: attach an OpenAI Chat Model sub-node with the credential from the “Configuration” section — the agent will think with a Mixen model. Add a suitable tool sub-node from the panel (an API call, a calculator, code work) — an AI Agent requires at least one tool; add a memory sub-node if the dialog should survive between runs.

Task Model Price per 1M tokens
Bulk automations: descriptions, classification, field extraction z-ai/glm-5.3-flash 8.4 ₽ input / 27.9 ₽ output
Hard steps: tangled data parsing, long context anthropic/claude-sonnet-5 213.9 / 1069.5 ₽

The scale of the prices: a request with 1,000 input and 200 output tokens on glm-5.3-flash costs about 0.014 ₽ — a thousand such runs ≈ 14 ₽. A flagship is an order of magnitude more expensive for the same job, so the typical n8n layout is: a cheap model on the stream, a flagship on the steps where quality decides.

Prompt cache: an identical repeating request prefix within 5 minutes is billed at ~10% of the input price (for claude-sonnet-5 — 21.4 ₽ per 1M instead of 213.9 ₽, for glm-5.3-flash — 1.7 ₽), and every hit extends the window by another 5 minutes. If a workflow fires uniform requests in a row with the same system prompt, the savings accumulate on their own.

Model ID
GPT-5.6 Sol openai/gpt-5.6-sol
Claude Opus 5 anthropic/claude-opus-5
GLM 5.3 z-ai/glm-5.3
DeepSeek V4 Pro deepseek/deepseek-v4-pro
Kimi K3 moonshotai/kimi-k3

Full list — in the catalog.

  • 401 / Unauthorized — the key was copied incompletely or isn’t an API key; issue a new one in the dashboard, it starts with mxn-. For HTTP Request, check that the header is exactly Authorization: Bearer mxn-… — without the Bearer prefix the key isn’t recognized.
  • No Base URL field in the credential — an outdated n8n version; update your instance or use the HTTP Request node (see above).
  • OpenAI node operations fail (Assistants, Files) — Mixen does not support the Assistants API; for text generation use the “Message a model” (chat completions) operation — it works fully.
  • Empty text in the response — check the expression path: {{ $json.choices[0].message.content }}; if you enabled the Include Response Headers and Status option, the response gets wrapped and the path grows longer.
  • “model not found” — pass the model ID from the catalog verbatim, including the vendor prefix (openai/…, anthropic/…).