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
Trae + JoinGonka Gateway — Gonka network models in AI-IDE
Trae is an AI-IDE with agents, an autonomous SOLO mode, and a set of built-in models whose consumption is deducted from the monthly plan limit. Since August 2026, the desktop environment is referred to as TraeCode in documentation — if you see this name in the interface or help, it refers to the same IDE.
In addition to built-in models, Trae can work with its own: in the Add Model window, there is a Custom Model option where you set the API format, request address, model ID, and key. There are two formats — OpenAI Chat Completions and Anthropic Messages — and JoinGonka Gateway supports both with a single key. This is how Trae agents get models from the decentralized Gonka network, paying per token at the network's live prices. After registering and verifying your address, you will receive 3M free tokens to your account — enough to test the setup on your project.
Menu item and field names below are based on official Trae documentation for the English interface; in a localized interface, the labels will be translated, but the sequence of steps remains the same.
What you will need: Trae build, version, and key
Build and version. Trae has two branches: the international one (documentation at docs.trae.ai) and the Chinese one (docs.trae.cn). The Custom Model form exists in both and works the same way; they differ in the built-in models and the set of presets under additional settings. Custom request URLs for your own model have been supported since version 3.5.51, released April 14, 2026 — if your build is older, update. The international build isn't available in every country: before installing, check the list of supported countries and regions.
System. macOS 12 or later, Windows 10 or 11 (x64), Linux in .deb and .rpm packages. On first launch, Trae will prompt you to choose a theme and language, import settings from VS Code or Cursor, and sign in to your account.
JoinGonka key. Register at the gateway, open the "API keys" section in your dashboard, and click "Create key". The key starts with jg- and is shown only once — save it right away. It's handy to create a separate key for Trae: under "Usage", its spend will show up on its own line.
Trae plan. Your own model must be selected manually from the model list, and in Trae's pricing table, the free plan shows only the Auto mode in the model selection row — your own models aren't used there. Whether this restriction applies to models added with your own key, the documentation doesn't say outright. The practical rule is simple: if Auto Mode can be turned off in the model list on your plan, you're all set; if not, you'll need a paid plan.
Connection: Settings → Models → Add Model → Custom Model
- Open Settings → Models — the model management panel.
- Click Add Model. In the window that opens, choose Custom Model rather than a provider from the ready-made list.
- Fill in the fields with the values from the table. There are two columns — one for each API format; pick one.
- Click Add Model. Trae will make a test API call and validate the key: on success the model appears in the list, on failure the window shows an error message and the provider's response log.
| Field | OpenAI Format | Anthropic Format |
|---|---|---|
| API Format | OpenAI Chat Completions | Anthropic Messages |
| Custom Request URL, Full URL toggle off | https://gate.joingonka.ai/v1 | https://gate.joingonka.ai |
| Custom Request URL, Full URL toggle on | https://gate.joingonka.ai/v1/chat/completions | https://gate.joingonka.ai/v1/messages |
The remaining fields don't depend on the format:
| Field | Value | Explanation |
|---|---|---|
| Model ID | deepseek-ai/DeepSeek-V4-Flash-0731 | The exact model identifier as returned by the gateway |
| Display Name | DeepSeek V4 Flash (Gonka) | The name shown in the model list; without it Trae displays the Model ID |
| API Key | jg-your-key | A single key works for both formats |
Which format to choose. Start with OpenAI Chat Completions: it's the gateway's primary path and most tools work with it. Anthropic Messages comes in handy if you're used to that format in other tools or want to compare how an agent behaves across the two protocols — the key and balance are shared.
How Full URL works. The toggle decides who appends the path. Off — you provide the base address and Trae adds the path for the chosen format: /chat/completions to the address with /v1 for OpenAI, and /v1/messages to the root for Anthropic. On — the address is used as-is and must contain the full path. The most common mistake is mixing the modes: entering a full path with the toggle off, or a base address with it on.
One entry — one model. Repeat the steps for the network's other models so you can switch between them without going back into settings: deepseek-ai/DeepSeek-V4-Flash-0731, MiniMaxAI/MiniMax-M2.7 and zai-org/GLM-5.3-Flash. The current list is served by GET https://gate.joingonka.ai/v1/models. An added model can later be edited, disabled (it stays in the panel but disappears from the chat list) or deleted.
Advanced Settings and Model Selection
Below the main fields is a collapsible Advanced Settings list. You don't have to touch it — Trae will use default values — but two settings should be set consciously: model series and context window.
| Setting | What to choose | Why |
|---|---|---|
| Model Series | Default | Series presets change prompts, hyperparameters, and context window based on vendor APIs. The Deepseek-4 preset, for example, raises limits to 616,000 tokens input and 384,000 output — this is more than the model provides in the Gonka network |
| Context Window (Token) | Input and output — according to the model table below | Trae will fill empty fields with its defaults; manually specified values have priority and will prevent the agent from gathering more context than the model accepts |
| Image Input Support | Off | Network models are text-based. With this setting off, Trae will warn you that the model does not accept images |
| Thinking Mode | Follow model default | The model handles reasoning itself; GLM-5.3 Flash has it enabled by default |
| Tool Call Rounds, Hyperparameters | Leave empty | Default values are appropriate; Temperature, Top P, and Top K can be set later if needed |
The price for network models is the same, so the choice depends on behavior. All models in the table support native tool calling, which powers Trae agents.
| Model | Model ID | Context Window: input / output | When to use in Trae |
|---|---|---|---|
| DeepSeek V4 Flash | deepseek-ai/DeepSeek-V4-Flash-0731 | 380000 / 32768 | Primary agent model: large repositories, long sessions, generation of bulky files — the largest response limit in the network |
| MiniMax M2.7 | MiniMaxAI/MiniMax-M2.7 | 200000 / 8192 | Quick edits, code questions, fragment explanation — short "ask-receive" cycles |
| GLM-5.3 Flash | zai-org/GLM-5.3-Flash | 390000 / 8192 | Reasoning model: "thinks" before answering. Design, complex debugging, analyzing third-party architecture; part of the output limit is consumed by reasoning |
How the reasoning budget is structured and why reasoning model output limits shouldn't be set too low is covered in the GLM-5.3 Flash review; a comparison of models for development tasks is in the article about the best AI models for code.
Verification and Diagnostics
Your models live in the general list: click on the name of the current model in the bottom right corner of the chat input field and select the one you added. There is also an Auto Mode switch there — it must be turned off: in Auto mode, Trae selects a model from the built-in ones itself and does not use the ones you have added.
Give the agent a task that requires a tool, for example: "Read package.json and list the build scripts." The agent should open the file and answer substantively — this means the "request — tool call — response" cycle is being assembled via the gateway. Then open the gateway dashboard, the "Usage" section: in the "By keys" block for the Trae key, requests and the time of the last access will appear, and in the "By models" block — the selected model.
If something goes wrong, look at the error text. Trae does not hide the response of your own model: it shows the provider error as is, with its own code 4028.
| What is visible | What it means | What to do |
|---|---|---|
401, Invalid API key — in the Add Model window or in the chat | Gateway did not recognize the key | Check that the key starts with jg-, is pasted without spaces, and is active in the "API keys" section |
404, Invalid URL (POST …) | Extra segment in the path; in the error text, the gateway shows where the request arrived | Verify the address with the table: the full path is only allowed when Full URL is enabled, and the base address for the Anthropic format is written without /v1 |
405 Not Allowed, 301 or HTML instead of a response | Request went past the API: for the OpenAI format, /v1 is missing in the base address or, with Full URL enabled, only the base address is specified | Bring the address to one of the table options: base when Full URL is disabled, full path when enabled |
Code 984, Incorrect model name | Model ID did not match the identifier on the gateway | Copy the identifier from the model table character by character |
Code 4028 and text with 429 | Model is overloaded: during peak hours, the capacity of a specific model in the network may be fully utilized | Try again in a few seconds or switch to a neighboring model; the network status is visible on the status page |
Code 4054, Model Request failed | Request to your model did not reach or was interrupted | Check the status page to see if the gateway is available, and verify the model record settings via Edit: format, address, identifier |
| Code 7000: model does not accept images | An image is attached to the message, but the network models are text-only | Remove the image or use a built-in model with vision for this task |
| Your model is selected, but another one responds | Auto Mode is enabled | Turn it off in the model list |
How much it costs
An agent in the IDE consumes tokens faster than a chat: every request includes system instructions, tool descriptions, open files, and the history of steps. Therefore, the price per token determines whether you can run the agent for every trifle or have to save.
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 models in the network and is pulled from a live source on this page. The order of amounts based on prices as of September 2026:
| Scenario | Consumption | Via Gateway |
|---|---|---|
| One-time task: read files and make edits | tens of thousands of tokens | fractions of a cent |
| A day of active work with the agent | 3-7M tokens | a few cents |
| A month of daily development | ~150M tokens | around one to two dollars |
Comparing it with Trae itself is revealing because open models exist among the built-in ones as well, and Trae publishes their price list per million tokens. DeepSeek-V4-Flash and MiniMax-M2.7 cost $0.30 for input and $1.20 for output there, and GLM-5.3 Flash is not in the international built-in list at all. Through the gateway, the difference for the same models is approximately ×43 for input and ×58 for output.
| Method | How it is calculated | What limits it |
|---|---|---|
| Trae built-in models | By tokens according to the Trae price list, from the monthly Dollar Usage limit; above the limit — additional On-Demand Usage payment | Plan limit and its price |
| Your model + JoinGonka Gateway | By tokens at network price, from the gateway balance | Only the balance: consumption is visible in the dashboard by day, keys, and models |
Things to consider
Your custom model works where the model list is available. This applies to chat and agents — both in IDE mode and in SOLO (custom models have been supported since version 3.3.0). Autocompletion and edit prediction are handled by a separate CUE mechanism with its own settings panel: it does not support model selection, and its limits are set by the Trae plan.
Tools and MCP. Trae agents act as MCP clients, and the servers you connect remain available to the agent using your custom model: all network models support native tool calling. If Trae reports that the tool argument schema is incompatible with the model (code 4027), try a neighboring network model or a different MCP server.
TraeWork. In the separate TraeWork application, the form for adding your custom model is the same, but according to the documentation, it only works in TraeWork Desktop and only for tasks in a local environment.
Plugin for other editors. The TraeCode plugin documentation for VS Code and JetBrains does not contain a section on custom models — this guide refers to the desktop IDE. If you are staying in VS Code, the same gateway is connected via agent extensions, for example, Cline.
Privacy. The Privacy Mode setting (Settings → Account) controls what Trae itself does with your dialogues and code snippets: with it enabled, they are not used for analytics or training. On the gateway side, dialogues are not stored: prompts and responses do not remain there after the response; only request and token counters are visible in the dashboard.
If you need to work with images — a layout, an error screenshot — assign such a task to a built-in model with vision, and leave the code, commands, and files to the network model: switching takes one click in the model list.
Want to learn more?
Explore other sections or start earning GNK right now.
Get key and free tokens →