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
MiniMax Code: MiniMax agent with your own key via Gonka
MiniMax Code (command mcode) is a terminal-based coding agent from the MiniMax lab: it analyzes the project, edits files, runs commands and tests, and you control it from a TUI, from scripts, or from an editor. The source code for the terminal version is open, and the vendor's own code is under an MIT license. The product is young and changes quickly, so everything below is tied to version 0.5.1, on which we went from installation to the agent's response.
By default, mcode works through a vendor account and a Token Plan subscription. But it also supports BYOK: your own endpoint and your own key, and you don't need to log in to an account for this—it's explicitly stated in the README. Three API formats are supported: openai-completions, openai-responses, and anthropic-messages; JoinGonka Gateway speaks all three.
The scenario is symmetrical. The Gonka network serves the open MiniMax M2.7 model, and along with it DeepSeek V4 Flash and GLM-5.3 Flash—all at the same price. The vendor's agent works on the same vendor's model, but it is calculated by a decentralized network, and you pay for actual tokens; you can switch to a neighboring model with one command within a session.
What is MiniMax Code and how to install it
The agent has three entry points, and all three work with a BYOK provider the same way:
| Entry point | Command | What it's for |
|---|---|---|
| Interactive TUI | mcode [prompt] | Explore code, hold a conversation, review edits and permissions |
| Headless | mcode exec [prompt] | Scripts, CI, batch tasks |
| ACP | mcode acp | Editors and clients with Agent Client Protocol support |
The official installer places the latest version in ~/.minimax-code, pulls in a suitable Node.js if needed, and requires no administrator rights:
# macOS / Linux / WSL
curl -fsSL https://filecdn.minimax.chat/public/install.sh | bash
# Windows (PowerShell)
irm https://filecdn.minimax.chat/public/install.ps1 | iexIf you already have Node.js (22.19 or newer in the 22 line, 24.2 or newer in the 24 line, plus 25 and 26), npm will work:
npm install -g @minimax-ai/code@latest --registry=https://registry.npmjs.org/ --ignore-scripts=false --include=optional --allow-scripts=@minimax-ai/code,better-sqlite3The long command isn't a mistake: the agent needs a native SQLite build, so optional dependencies and install scripts must stay enabled. After installing, reopen your terminal and check: mcode --version.
Inside the TUI, these come in handy: Shift+Tab (planning mode), Alt+M (switch permission modes — Ask, Auto, and Full access), @ to reference a file, and /help for the command list. An interrupted session resumes with mcode --continue, and mcode init . creates an AGENTS.md file in the project with rules for the agent.
User data — config.yaml, sessions, login state — lives separately from the program, in the ~/.minimax directory (for a named profile, ~/.minimax-<profile>); the MINIMAX_DATA_DIR variable sets a different location.
JoinGonka key. Sign up at gate.joingonka.ai/register: after you confirm your address, 3M free tokens will land in your account. Create a key with the jg- prefix in your dashboard, under "API keys"; it's handy to set up a separate one for the agent — its traffic will show up as a separate line.
Fast track: one-command installer
Close mcode if it's running, then run:
npx @joingonka/setup --tool minimax-code --model minimaxThe installer will ask for your key, save a copy of the existing config.yaml, append only its own block to it, and finish with a live request to the gateway: the key, address, and model are verified right away, not on your first task. In ~/.minimax/config.yaml a joingonka provider will appear under the custom_provider branch — that's where mcode keeps third-party endpoints:
custom_provider:\n joingonka:\n name: JoinGonka\n kind: custom\n enabled: true\n api: openai-completions\n options:\n apiKey: jg-your-key\n baseURL: https://gate.joingonka.ai/v1\n authMode: api-key\n models:\n MiniMaxAI/MiniMax-M2.7:\n name: MiniMax M2.7 (Gonka)\n limit:\n context: 200000\n output: 8192\n deepseek-ai/DeepSeek-V4-Flash-0731:\n name: DeepSeek V4 Flash (Gonka)\n reasoning: true\n limit:\n context: 380000\n output: 32768\n zai-org/GLM-5.3-Flash:\n name: GLM 5.3 Flash (Gonka)\n reasoning: true\n limit:\n context: 390000\n output: 8192\ndefaultModel: custom_provider:joingonka/MiniMaxAI/MiniMax-M2.7A few things worth knowing about this block:
- The API format is set explicitly. Without the
apifield, mcode treats the provider as Anthropic-compatible; the installer picksopenai-completions— the gateway's canonical path. - Each model has its own limits. For an unfamiliar model, mcode assumes a 200,000 window and a 16,384-token response; the network's real values differ, so
limitis set for all three entries. - The key is stored in the file as a literal, and the file itself gets
600permissions. That's how mcode stores keys too: its--api-key-envflag reads the variable and writes the value into the config, not a reference. - Default model. The
--model minimaxflag sets MiniMax M2.7. Without the flag, the installer picks DeepSeek V4 Flash for coding agents — it has a bigger window and response ceiling — while--model glmgives you GLM-5.3 Flash. If a model from another provider is already selected in the config, re-running without--modelwon't touch it. - Profiles. For a named profile, run the installer with an environment variable, e.g.
MINIMAX_DATA_DIR=~/.minimax-work.
Please close mcode during installation for a real reason: the agent rewrites config.yaml in full on its own saves and can overwrite an edit made behind its back.
Manual configuration: mcode provider add and config.yaml
The agent's built-in command gives the same result. The key is passed via an environment variable — it has no business being in arguments or shell history:
# read the key without echo\nread -s JOINGONKA_API_KEY\nexport JOINGONKA_API_KEY\n\nmcode provider add --name JoinGonka \\\n --base-url https://gate.joingonka.ai/v1 \\\n --api-format openai-completions \\\n --model MiniMaxAI/MiniMax-M2.7 \\\n --api-key-env JOINGONKA_API_KEY \\\n --context-limit 200000 --output-limit 8192 --useThe --use flag first tests the first of the listed models with a live request and only then saves the provider and sets the model as default; on failure, nothing is saved. A successful run ends with the line Provider added and selected: JoinGonka. From the name, mcode derives the provider key itself — joingonka — so an installer run later will update the same entry rather than create a second one.
The --context-limit and --output-limit flags apply to all models listed in the command, while the network's models have differing limits. So it's convenient to set up one model with the command and add the rest in the file. Close mcode and merge this fragment with the existing provider block in ~/.minimax/config.yaml:
custom_provider:\n joingonka:\n models:\n MiniMaxAI/MiniMax-M2.7:\n limit: { context: 200000, output: 8192 }\n deepseek-ai/DeepSeek-V4-Flash-0731:\n limit: { context: 380000, output: 32768 }\n zai-org/GLM-5.3-Flash:\n limit: { context: 390000, output: 8192 }The third way is interactive: inside the TUI, the /model command opens model selection with a + Add 3rd-party provider… option, while /provider manages saved connections. The address on the model screen is edited with Ctrl+E; a failed check saves nothing, and the draft remains for editing.
Which API format to choose. The gateway accepts all three; only the base URL differs:
--api-format | --base-url | When to choose it |
|---|---|---|
openai-completions | https://gate.joingonka.ai/v1 | The main option: the gateway's canonical path, and the one the installer writes. We ran the full agent cycle on it |
openai-responses | https://gate.joingonka.ai/v1 | If the rest of your environment is built around the Responses API |
anthropic-messages | https://gate.joingonka.ai | Anthropic Messages format: the agent appends the /v1/messages path itself. This is also the value mcode uses when --api-format isn't specified |
In our run, all three formats passed the connection check.
Verification and Common Errors
Three commands show that the integration is working. The first lists providers — the active one is marked with an asterisk, the key is masked:
mcode provider list
* custom_provider:joingonka active jg-a****9f3cThe second makes a live request and, on success, responds with Provider available: custom_provider:joingonka; the --model flag checks a specific model:
mcode provider test custom_provider:joingonkaThe third checks the most important thing — file operations. Put a small file with an obvious bug in the directory and ask it to find it:
mcode exec "Read calc.py and tell me in one sentence whether it has a bug."The agent should call the read tool on its own and give a substantive answer. In our run, all three models on the network performed this way; you can specify a different model for a single run with a flag like --model custom_provider:joingonka/<model-id>. With the --output-format json flag, the response includes a usage field with the number of input and output tokens — handy for cross-checking with the gateway dashboard: the "Usage" section shows requests by hour and by day, broken down by model and by key.
If the check fails, mcode states the reason right in the message:
| What you see | What it means | What to do |
|---|---|---|
Authentication failed (HTTP 401) | The gateway rejected the key | Check that the variable from --api-key-env is exported in the same shell and contains the full key |
HTTP 405 on the check | The OpenAI-format URL is missing its suffix | The URL must end with /v1: the agent appends /chat/completions itself |
HTTP 400: Model "…" not found. Available: … | The identifier was entered without the vendor prefix | Copy the id from the list that the gateway provides in the message itself |
Request timed out after 10000ms | The connection check waits ten seconds, but the network under load responded later | Repeat the command. Or save the provider without --use and test it separately with mcode provider test |
429 … currently overloaded … (rate limit) | The model currently has no spare capacity on the network | Retry in a minute or switch to a neighboring model with the /model command; the status is shown on the status page |
The provider's models don't appear in /model | The provider is disabled or the edit was overwritten by a running mcode | Close the agent and repeat the installation: it restores enabled: true and the model catalog |
| A large context window is used only halfway, or the response cuts off earlier than expected | The model was added without limits: the agent assumes a window of 200,000 and a response of 16,384 tokens | Set limit as in the examples above |
Which model to choose
All models on the network share one price, so the choice comes down to behavior. Below are the limits and how the models behaved in our mcode exec run on the same task (verified September 21, 2026):
| Model | Identifier | Context / response | How it behaves in mcode |
|---|---|---|---|
| MiniMax M2.7 | MiniMaxAI/MiniMax-M2.7 | 200K / 8192 | A model from the same vendor as the agent itself. In our run it responded faster than the others. Reasoning arrives in a separate reasoning_content field, and the response text contains only the answer |
| DeepSeek V4 Flash | deepseek-ai/DeepSeek-V4-Flash-0731 | 380K / 32768 | A clean, to-the-point answer. A large window and the biggest response ceiling on the network — which is why the installer sets it as the default |
| GLM-5.3 Flash | zai-org/GLM-5.3-Flash | 390K / 8192 | A reasoning model: it thinks before answering, and the answer itself is clean. Reasoning counts toward the response limit, so don't set output too low |
The rule of thumb is simple. For short tasks and quick edits, use MiniMax M2.7: it currently accounts for the largest share of the network's capacity. If visible reasoning gets in the way — for example, when a script parses the exec output — or you need to read a large repository and get a long edit, switch to DeepSeek V4 Flash. For tangled logic, GLM-5.3 Flash thinks better.
Switching doesn't require editing a file: in the TUI it's the /model command, for one session it's mcode -m custom_provider:joingonka/<model-id>, and for one run it's mcode exec --model with the same value. Your persistent choice is stored in the defaultModel line. The network's lineup changes over time; the current list with limits is always available from GET https://gate.joingonka.ai/v1/models.
How much it costs and what to consider
Agent tools consume tokens differently than chat: for every phrase of yours, mcode adds a system prompt and descriptions of all tools, and then conducts a multi-turn dialogue with the model. In our run, the task "read a file and find an error" cost approximately 40,000 tokens, almost all of which was input. Therefore, the price per token is the deciding factor here.
Through JoinGonka Gateway, tokens cost $0.0069 per million for input and $0.021 per million for output — the price is the same for all models in the network and is pulled onto this page from a live source. Orders of magnitude for prices as of September 2026: a one-time task — hundredths of a cent, a day of active work for 3-7 million tokens — a few cents.
| Method | How it is paid | Requirements |
|---|---|---|
| Vendor account and Token Plan | Subscription with credits | Login via mcode login and available credits |
| JoinGonka Gateway (BYOK) | Per actual tokens from balance | jg-… key; no need to log into a vendor account, usage visible in the dashboard |
What BYOK covers. Your provider handles model requests: code reading and editing, commands, subagents, and sessions. Built-in search, mcode-tools media tools, and managed connectors are the vendor's own services; they require account login and credits. Custom tools connect independently of this, via MCP servers in the project's .mcp.json file.
Permissions. In TUI, Ask, Auto, and Full access modes are switched via Alt+M or the /permission command; for mcode exec, the --permission flag controls this.
Telemetry. Statistics, metrics, and diagnostic channels in mcode are disabled by default and enabled separately; the MCODE_DISABLE_TELEMETRY and DO_NOT_TRACK variables disable them all at once. The gateway, for its part, does not store the content of prompts and responses — only usage aggregates remain in the statistics.
If you need image processing — interface screenshots, mockups — set up a second provider with a vision-capable model, specifying the --support-image flag when adding it: Gonka network models are text-only, and you can have multiple providers in mcode.
Agents from the labs themselves exist for all three model families in the network: alongside MiniMax Code are DeepSeek Harness and ZCode from Z.ai, the creators of GLM. All three connect to the same gateway with the same key.
npx @joingonka/setup --tool minimax-code --model minimax: the installer will write the joingonka provider to ~/.minimax/config.yaml with openai-completions format, https://gate.joingonka.ai/v1 address, and correct MiniMax M2.7, DeepSeek V4 Flash, and GLM-5.3 Flash limits, and then verify the connection with a live request. Manually, mcode provider add … --use does the same. Verification — mcode provider test custom_provider:joingonka, model switching — /model. Pay for actual tokens at Gonka network prices, no subscriptions or quotas.Want to learn more?
Explore other sections or start earning GNK right now.
Get a key and free tokens →