Knowledge Base Sections ▾
Navigation
▸ Start here By rolesCategories
- Cursor + Gonka AI - cheap LLM for coding
- Claude Code + Gonka AI - LLM for the terminal
- OpenClaw + Gonka AI - affordable AI agents
- OpenCode: your own model in the terminal
- Continue.dev + Gonka AI - AI for VS Code/JetBrains
- Cline + Gonka AI - AI agent in VS Code
- Aider + Gonka AI - pair programming with AI
- LangChain + Gonka AI - AI applications for pennies
- n8n + Gonka AI - automation with cheap AI
- Open WebUI + Gonka AI - your own ChatGPT
- LibreChat + Gonka AI — open-source ChatGPT
- Hermes Agent + DeepSeek on the Gonka network — an autonomous agent for pennies
- Kilo Code + Gonka AI — AI-Agent in VS Code
- Roo Code + Gonka AI — Autonomous AI Agent in VS Code
- LlamaIndex + Gonka AI — RAG applications for pennies
- PydanticAI + Gonka — typed AI agents for pennies
- Vercel AI SDK + Gonka AI — AI applications in TypeScript for pennies
- TanStack AI + Gonka — AI applications in TypeScript for pennies
- API quick start — curl, Python, TypeScript
- JoinGonka Gateway — a full overview
- Management Keys — SaaS on Gonka
- Cheapest AI API: Provider Comparison 2026
- How to buy AI tokens and an API key: 3 methods in 2026
- Cursor Pro request limit reached — breakdown and cheaper alternative
- Claude Code is cheaper — bill breakdown and switching
- Cline is burning money — why the agent spends so much
- OpenClaw is expensive — why the agent burns through tokens and how to save
- OpenRouter: Cheap Alternative — Comparison with JoinGonka Gateway
- Best AI model for coding in 2026: comparison and prices
- Cheap alternative to GitHub Copilot without limits
- A cheap Windsurf alternative without credits or limits
- The cheapest API for AI agents in 2026
- ZCode: Cheap GLM inference instead of GLM Coding Plan
- JetBrains IDE + JoinGonka Gateway — your own endpoint instead of credits
- GitHub Copilot BYOK — own models instead of quotas
- Zed + JoinGonka Gateway — cheap inference in your editor
- Pi + JoinGonka Gateway — terminal agent on cheap inference
- Codex CLI: your own key instead of a subscription
- DeepSeek Harness: Your Own Provider via JoinGonka Gateway
- MiniMax Code: MiniMax agent with your own key via Gonka
- Warp + JoinGonka Gateway — terminal agent on your own endpoint
- Trae + JoinGonka Gateway — Gonka network models in AI-IDE
- Cherry Studio + JoinGonka Gateway — desktop AI client
- omp (Oh My Pi) + JoinGonka Gateway: an agent with model roles
- OpenHands + JoinGonka Gateway: agent on your own endpoint
- Qwen Code after the closure of qwen-oauth: working via JoinGonka Gateway
- Goose + JoinGonka Gateway: your own provider and key in the keyring
- Crush + JoinGonka Gateway: Charm agent on Gonka network models
- Zoo Code + JoinGonka Gateway: Migrating from Roo Code to Gonka models
- Kimi Code CLI: Moonshot AI agent on your key via Gonka
- Factory Droid + JoinGonka Gateway: BYOK on Gonka network models
- MiMo Code + JoinGonka Gateway: Xiaomi agent on Gonka network models
Tools
MiMo Code + JoinGonka Gateway: Xiaomi agent on Gonka network models
MiMo Code (the mimo command) is a terminal coding agent from the Xiaomi MiMo lab: it reads and writes code, executes commands, works with Git, and maintains persistent project memory across sessions. It is a fork of OpenCode: everything the parent project can do is present, with added session checkpoints, context restoration, sub-agents, and ready-made workflows. The code is open-source under the MIT license; the project is young and changing rapidly, so everything below is tied to version 0.1.15, released on September 22, 2026.
The inference layer in MiMo Code is swappable: any OpenAI-compatible API can be connected as a provider by adding a description in mimocode.jsonc and a key in auth.json. The JoinGonka Gateway is exactly that, so the setup process comes down to a single installer command.
There are no proprietary MiMo models on the Gonka network: the decentralized network serves DeepSeek V4 Flash, GLM-5.3 Flash, and MiniMax M2.7 — all at the same price of $0.0069 per million input tokens. The agent is not tied to Xiaomi models: providers are interchangeable, and the entire framework — memory, checkpoints, sub-agents — runs on top of the model you choose. The commands, files, and messages below were verified by a live run of MiMo Code through the gateway on September 23, 2026. After confirming your address, 3M free tokens will be credited to your account — enough to repeat all this yourself.
Quick Start: Installation and One Command
Step 1: install MiMo Code. The official methods from the project README:
# macOS and Linux
curl -fsSL https://mimo.xiaomi.com/install | bash
# Windows (PowerShell)
powershell -ep Bypass -c "irm https://mimo.xiaomi.com/install.ps1 | iex"
# via npm, on any system
npm install -g @mimo-ai/cliThe script installs the binary into ~/.mimocode/bin and adds that directory to PATH through your shell profile (the --no-modify-path flag disables this). It downloads the build from Xiaomi's repository; if the download fails, install via npm — it is the same release, and we got 0.1.15 both ways. To verify, run mimo --version.
Step 2: get a key. Sign up at gate.joingonka.ai/register, confirm your address and create a key with the jg- prefix under the "API Keys" section. One key and one balance work for every model on the network.
Step 3: run the installer.
npx @joingonka/setup --tool mimo-codeThe installer will ask for your key — it is not passed in command-line arguments — and writes the same two files as MiMo Code's own provider wizard, only with the full catalog and limits right away:
- registers the
joingonkaprovider in the global config~/.config/mimocode/mimocode.jsonc(or inmimocode.jsonorconfig.json, if MiMo Code is already writing there): the@ai-sdk/openai-compatibleadapter, the gateway address with/v1, and three models on the network with context windows, response ceilings and tool support; - puts the key in MiMo Code's own key storage —
~/.local/share/mimocode/auth.jsonwith600permissions. The config itself contains no key, so you can safely keep it in dotfiles; - sets the default model — the
modelfield — to DeepSeek V4 Flash, but only if none is selected or the current one points to a model that has left the network. It does not override a choice you made, including in another global config; - saves copies of the previous files, leaves other providers, keys and comments untouched, and does not overwrite a file it cannot parse — it stops and tells you what to fix;
- finally, sends a live request to the gateway and tells you plainly whether the key, address and model were accepted.
The installer handles non-standard directories on its own: MIMOCODE_HOME, XDG_CONFIG_HOME, XDG_DATA_HOME and MIMOCODE_CONFIG. To set a different default model, use the --model flag with the shorthand deepseek, glm or minimax; for dotfiles and servers there is a non-interactive mode:
JOINGONKA_API_KEY=jg-your-key npx @joingonka/setup --tool mimo-code --non-interactiveIf MiMo Code was running, restart it: the new provider is picked up at startup.
Manual Configuration: mimocode.jsonc and auth.json
Everything the installer does can be done by hand. There are two files, and each has its own job: the config describes the provider and the models, auth.json holds the key. The provider identifier ties them together — joingonka must match in both files. The config, ~/.config/mimocode/mimocode.jsonc:
{
"$schema": "https://mimo.xiaomi.com/mimocode/config.json",
"provider": {
"joingonka": {
"npm": "@ai-sdk/openai-compatible",
"name": "JoinGonka (Gonka)",
"options": {
"baseURL": "https://gate.joingonka.ai/v1"
},
"models": {
"deepseek-ai/DeepSeek-V4-Flash-0731": {
"name": "DeepSeek V4 Flash (Gonka)",
"tool_call": true,
"reasoning": true,
"limit": { "context": 380000, "output": 32768 }
},
"zai-org/GLM-5.3-Flash": {
"name": "GLM 5.3 Flash (Gonka)",
"tool_call": true,
"reasoning": true,
"limit": { "context": 390000, "output": 8192 }
},
"MiniMaxAI/MiniMax-M2.7": {
"name": "MiniMax M2.7 (Gonka)",
"tool_call": true,
"limit": { "context": 200000, "output": 8192 }
}
}
}
},
"model": "joingonka/deepseek-ai/DeepSeek-V4-Flash-0731"
}The key, ~/.local/share/mimocode/auth.json with 600 permissions:
{
"joingonka": { "type": "api", "key": "jg-your-key" }
}| Field | Value | What matters |
|---|---|---|
provider.joingonka | provider identifier | Lowercase; the same key goes in auth.json, otherwise MiMo Code won't link the key to the provider |
npm | @ai-sdk/openai-compatible | The adapter for OpenAI-compatible APIs — MiMo Code uses it to talk to the gateway over Chat Completions |
options.baseURL | https://gate.joingonka.ai/v1 | With /v1 at the end: MiMo Code appends the /chat/completions path itself |
models | keys are the network's model ids | The identifier is sent in the request as-is, vendor prefix and all |
limit | context and output per the list above | Without them MiMo Code assumes the model's window is a million tokens and starts compressing the history too late — the request will hit the model's real limit |
tool_call | true | The model calls tools. For its own models MiMo Code assumes this by default anyway; the installer writes the flag explicitly |
reasoning | true | The reasoning-model marker: DeepSeek V4 Flash and GLM-5.3 Flash get it, while the MiniMax M2.7 entry does without |
The default model is written as provider/model-id; the provider is split off at the first slash, so network identifiers with a slash of their own are written as-is.
Where else the key can live. The MiMo Code README also shows the option of putting the key straight in the config — options.apiKey. It works, but then the key is easy to commit along with your dotfiles, and a stale key left there will override the new one from auth.json — which is why the installer removes options.apiKey from its block. And definitely don't put the key in the project's .mimocode/mimocode.jsonc.
Which file wins. MiMo Code merges the global config.json, mimocode.json and mimocode.jsonc in that order, each one overriding the previous. The result is printed by mimo debug config, and the paths to the config and keys on your system by mimo debug paths.
Provider from the interface, auth.json, and model selection
You can set up your provider without files using the built-in wizard. Upon the first launch, MiMo Code in the project directory asks if you trust the folder (Yes, I trust this folder): the agent will gain permission to read, edit, and run files within it. Then the /connect command opens the Select provider list: at the top, there is access to the Xiaomi MiMo platform, Codex, and import from Claude Code, below is the directory of providers, and at the very end is + Custom provider. The wizard asks six questions:
| Step | What to enter | Note |
|---|---|---|
| Provider id (1/6) | joingonka | The same id as the installer: if run later, it will update this entry instead of creating a second one |
| Display name (2/6) | JoinGonka | Label in lists; defaults to the id |
| Base URL (3/6) | https://gate.joingonka.ai/v1 | With the /v1 suffix |
| API key (4/6) | your jg-… key | Goes into auth.json, not written to config |
| First model id (5/6) | deepseek-ai/DeepSeek-V4-Flash-0731 | Full model id of the network, with the vendor prefix |
| First model name (6/6) | DeepSeek V4 Flash | Label; defaults to the id itself |
In our run, the wizard recorded a provider block with one model without limits and two fields that the installer does not have: env with the variable name JOINGONKA_API_KEY, where MiMo Code will also search for the key, and options.setCacheKey: true. This works with the gateway, but the configuration should be finished: without limit, mimo models joingonka will show a 1M token window. The easiest way is to run the installer once after the wizard — it will append the full catalog with limits to the same block.
Selecting a model. A constant selection is the model field in the config. In the interface, the model is changed by the /models command, for a one-time run — by the -m flag. To see which models MiMo Code sees from the provider and what window it works with, use mimo models joingonka — along with the threshold at which the agent will start compressing the history:
joingonka/deepseek-ai/DeepSeek-V4-Flash-0731 — window 380K, compacts at 342K
joingonka/MiniMaxAI/MiniMax-M2.7 — window 200K, compacts at 180K
joingonka/zai-org/GLM-5.3-Flash — window 390K, compacts at 351KThe price for all network models is the same, so the choice is about behavior. This is how they performed in our mimo run on a single task — reading a file and finding a bug:
| Model | Context / response | Behavior in MiMo Code |
|---|---|---|
| DeepSeek V4 Flash | 380K / 32768 | Solves the task correctly; the largest response limit in the network — its installer sets it by default |
| GLM-5.3 Flash | 390K / 8192 | Clean response in two steps and a few seconds. Reasoning model: reasoning is included in the response limit |
| MiniMax M2.7 | 200K / 8192 | Solves the task correctly. The model's reasoning comes separately from the response: by default, mimo run shows only the response and tool calls, while the --thinking flag also outputs reasoning |
Why DeepSeek V4 Flash is chosen by default is explained in the model overview.
Verification: what should happen
First, make sure MiMo Code can see the provider and the key:
mimo models joingonka
mimo providers listThe first command lists the three network models with their context windows, as in the example above; the second prints the path to the key store and the line joingonka api. Then do a one-off run. Put a file calc.py in your project directory with an obvious bug — say, the area of a rectangle where the sides are added instead of multiplied — and ask it to find the bug:
mimo run "Read the file calc.py in the current project directory and tell me in one sentence whether it has a bug."The output will show the agent and model (> build · deepseek-ai/DeepSeek-V4-Flash-0731), the tool call (→ Read calc.py) and a response that gets to the point — naming the faulty expression. The --format json flag turns the output into a stream of events, where each step has a token counter, and -m joingonka/<model-id> runs it on a different model. In our run, all three network models completed the loop "request → tool call → result → response".
The third check is on the gateway side: in the dashboard under "Usage", the request will show up in the "By model" breakdown, and the "By key" section will update the time of the last request.
If something goes wrong, the diagnosis is usually right there in the message:
| What you see | What it means | What to do |
|---|---|---|
Error: Invalid API key | The gateway rejected the key | Check the key in auth.json or run the installer again; note that options.apiKey in the provider block overrides auth.json |
Error: Method Not Allowed | The baseURL is missing the /v1 suffix | The address must be exactly https://gate.joingonka.ai/v1 |
Error: Model not found: joingonka/… Did you mean: …? | The model isn't in the provider's models list — most often the id was entered without the vendor prefix | Take the full id from the hint or from mimo models joingonka |
permission requested: external_directory (…); auto-rejecting, and the run ends without a response | In mimo run, access outside the project is denied and the run stops. This happens when the model looks for a file outside the project — in your home directory, for example | Specify that the file is in the project directory; a permission.external_directory rule grants permanent access to the directory you need |
mimo models joingonka shows a 1M window | The model has no limit — this happens after the Custom provider wizard | Set a limit in the config or run the installer |
429 … is currently overloaded in the Gonka network (rate limit) | The model currently has no free capacity on the network | Try again in a minute or switch to a neighboring model with the /models command or the -m flag; you can check the state on the status page |
402 | Your balance is out of funds | Top up in the "Billing" section; the key itself still works |
| The response cuts off mid-sentence | The response stream was interrupted along the way — this happens at peak hours | mimo run -c "continue" will resume the last session from where it left off |
How much it costs
Agentic tools spend tokens differently than chats: MiMo Code adds a system prompt, tool descriptions, and agent service context to each of your phrases, and the task takes several steps. In our run, each request to the model carried 22–25 thousand input tokens, and the task of “reading a file and finding an error” which took two steps cost about 45–50 thousand tokens — almost all of it being input. Therefore, the price per token is what matters here.
Via JoinGonka Gateway, tokens cost $0.0069 per million for input and $0.021 per million for output — the price is the same for all network models and is pulled onto this page from a live source.
| Scenario | Consumption | Via Gateway |
|---|---|---|
| One-off task: read a file, find an error | 45-50K tokens | fractions of a cent |
| A day of active work | 3-7M tokens | a few cents |
| A month of active development | ~150M tokens | about a dollar |
The estimates in the right column are based on September 2026 prices. For comparison — how you can pay for models in MiMo Code in general:
| Method | How paid | What is needed |
|---|---|---|
| Xiaomi MiMo Platform | per platform terms | Xiaomi MiMo account, browser login |
| Codex | ChatGPT subscription | ChatGPT Plus or Pro plan, browser login |
| Vendor key from provider catalog | per vendor token pricing | separate key for each vendor |
| JoinGonka Gateway | per tokens from prepaid balance | jg-… key; three network models at one price, usage visible in the dashboard |
The cost estimate within MiMo Code for gateway models is zero — their records do not have a cost field, and in --format json events, "cost": 0 is shown. Actual consumption and balance are in your dashboard, in the “Usage” and “Billing” sections.
Things to consider
Permissions. In the MiMo Code interface, it asks for confirmation for risky actions, but in mimo run there is no one to ask—it rejects requests for access outside the project on its own. For trusted one-time environments, there is the --dangerously-skip-permissions flag (or the MIMOCODE_DANGEROUSLY_SKIP_PERMISSIONS=1 variable): it allows everything not explicitly forbidden by a rule—only within a container or sandbox. In the interface, a similar mode can be enabled for the duration of a session using /skip-permissions.
Agents. By default, build runs with a full set of tools, plan only reads and analyzes, and compose manages the process from specification to verified code; you can switch between them using Tab.
Long Context. At the context window limit, MiMo Code rebuilds the context from the latest checkpoint, project memory, and fresh messages; it calculates the threshold starting from limit.context. You can compress it earlier using the /context-limit command, separately for each model.
What is tied to the Xiaomi account. Voice input (/voice) recognizes speech using the MiMo platform model and is available after logging in. Code, commands, and sub-agents work through a connected provider—in our test run, without any login.
Images. The network models are text-based: in /modalities, leave only text for them, and for screenshots, set up a second provider with a model capable of vision.
MiMo Code and OpenCode are relatives with different settings. They have their own directories and files, so settings are not transferred from one to the other:
| OpenCode | MiMo Code | |
|---|---|---|
| Command | opencode | mimo |
| Config | ~/.config/opencode/opencode.json | ~/.config/mimocode/mimocode.jsonc |
| Keys | ~/.local/share/opencode/auth.json | ~/.local/share/mimocode/auth.json |
| Installer | --tool opencode | --tool mimo-code |
Version. The project updates frequently; for reproducibility, pin the version: npm install -g @mimo-ai/[email protected] or curl -fsSL https://mimo.xiaomi.com/install | bash -s — --version 0.1.15.
Agents from the labs themselves are also available for the families serviced by the network: MiniMax Code runs on its vendor's MiniMax M2.7 model; DeepSeek and Z.ai, the authors of GLM, have their own agents. They all connect to the same gateway with a single key.
npx @joingonka/setup --tool mimo-code will register the joingonka provider in ~/.config/mimocode/mimocode.jsonc (adapter @ai-sdk/openai-compatible, address https://gate.joingonka.ai/v1, DeepSeek V4 Flash, GLM-5.3 Flash, and MiniMax M2.7 with honest limits) and place the jg-… key in the native auth.json. You can do the same manually via the /connect wizard → + Custom provider, after which you should add the models and limits. Verification: mimo models joingonka and mimo run; in a single run, keep paths inside the project.Want to learn more?
Explore other sections or start earning GNK right now.
Get key and free tokens →