n8n
Connect n8n to Mixen — pay from your balance in roubles, with a catalog of 105+ models.
Installation
Section titled “Installation”n8n is a low-code automation platform. Options: n8n Cloud or self-hosted via Docker:
docker volume create n8n_datadocker run -it --rm --name n8n -p 5678:5678 \ -e GENERIC_TIMEZONE="Europe/Moscow" -e TZ="Europe/Moscow" \ -v n8n_data:/home/node/.n8n \ n8nio/n8nThe UI opens at http://localhost:5678.
Configuration
Section titled “Configuration”n8n nodes (OpenAI, OpenAI Chat Model) share the “OpenAI” credential, and its form has a Base URL field — that’s what we override:
- Add an OpenAI Chat Model node (for AI Agent chains) or an OpenAI node (for plain requests) to your workflow.
- In Credential to connect with, click Create new credential.
- Fill in:
API Key: your-api-keyBase URL: https://api.mixen.ai/v1Leave Organization ID empty. A key starting with mxn-… is issued in the dashboard.
- Save — n8n verifies the credential with a
GET /modelsrequest against the Base URL, i.e. against the Mixen catalog. - 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: promptValue: Colombia Supremo coffee, medium roast, 250 g, notes of caramel and citrusThe 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 Type → Header 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: answerValue: {{ $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 inGET /v1/models, fieldcapabilities.reasoning_efforts.
Alternative: AI Agent with our credential
Section titled “Alternative: AI Agent with our credential”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.
Model choice and economics
Section titled “Model choice and economics”| 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.
Recommended models
Section titled “Recommended models”| 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.
Troubleshooting
Section titled “Troubleshooting”- 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 exactlyAuthorization: Bearer mxn-…— without theBearerprefix 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/…).