Knowledge Base Sections ▾

Navigation

▸ Start here By roles

Categories

Tools 52
Glossary 12

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

  1. Open Settings → Models — the model management panel.
  2. Click Add Model. In the window that opens, choose Custom Model rather than a provider from the ready-made list.
  3. Fill in the fields with the values from the table. There are two columns — one for each API format; pick one.
  4. 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.
FieldOpenAI FormatAnthropic Format
API FormatOpenAI Chat CompletionsAnthropic Messages
Custom Request URL, Full URL toggle offhttps://gate.joingonka.ai/v1https://gate.joingonka.ai
Custom Request URL, Full URL toggle onhttps://gate.joingonka.ai/v1/chat/completionshttps://gate.joingonka.ai/v1/messages

The remaining fields don't depend on the format:

FieldValueExplanation
Model IDdeepseek-ai/DeepSeek-V4-Flash-0731The exact model identifier as returned by the gateway
Display NameDeepSeek V4 Flash (Gonka)The name shown in the model list; without it Trae displays the Model ID
API Keyjg-your-keyA 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.

SettingWhat to chooseWhy
Model SeriesDefaultSeries 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 belowTrae 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 SupportOffNetwork models are text-based. With this setting off, Trae will warn you that the model does not accept images
Thinking ModeFollow model defaultThe model handles reasoning itself; GLM-5.3 Flash has it enabled by default
Tool Call Rounds, HyperparametersLeave emptyDefault 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.

ModelModel IDContext Window: input / outputWhen to use in Trae
DeepSeek V4 Flashdeepseek-ai/DeepSeek-V4-Flash-0731380000 / 32768Primary agent model: large repositories, long sessions, generation of bulky files — the largest response limit in the network
MiniMax M2.7MiniMaxAI/MiniMax-M2.7200000 / 8192Quick edits, code questions, fragment explanation — short "ask-receive" cycles
GLM-5.3 Flashzai-org/GLM-5.3-Flash390000 / 8192Reasoning 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 visibleWhat it meansWhat to do
401, Invalid API key — in the Add Model window or in the chatGateway did not recognize the keyCheck 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 arrivedVerify 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 responseRequest 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 specifiedBring the address to one of the table options: base when Full URL is disabled, full path when enabled
Code 984, Incorrect model nameModel ID did not match the identifier on the gatewayCopy the identifier from the model table character by character
Code 4028 and text with 429Model is overloaded: during peak hours, the capacity of a specific model in the network may be fully utilizedTry again in a few seconds or switch to a neighboring model; the network status is visible on the status page
Code 4054, Model Request failedRequest to your model did not reach or was interruptedCheck 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 imagesAn image is attached to the message, but the network models are text-onlyRemove the image or use a built-in model with vision for this task
Your model is selected, but another one respondsAuto Mode is enabledTurn 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:

ScenarioConsumptionVia Gateway
One-time task: read files and make editstens of thousands of tokensfractions of a cent
A day of active work with the agent3-7M tokensa few cents
A month of daily development~150M tokensaround 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.

MethodHow it is calculatedWhat limits it
Trae built-in modelsBy tokens according to the Trae price list, from the monthly Dollar Usage limit; above the limit — additional On-Demand Usage paymentPlan limit and its price
Your model + JoinGonka GatewayBy tokens at network price, from the gateway balanceOnly 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.

Trae connects to the JoinGonka Gateway via Settings → Models → Add Model → Custom Model: OpenAI Chat Completions format with the address https://gate.joingonka.ai/v1 or Anthropic Messages with the address https://gate.joingonka.ai, model identifier, and jg- key. The Full URL toggle decides who appends the path — do not mix modes. In advanced settings, leave the Default series and set the context window by model: DeepSeek V4 Flash — 380000 and 32768, MiniMax M2.7 — 200000 and 8192, GLM-5.3 Flash — 390000 and 8192. And do not forget to turn off Auto Mode: Trae does not use its custom models in it.

Want to learn more?

Explore other sections or start earning GNK right now.

Get key and free tokens →