Knowledge Base Sections ▾
Navigation
▸ Start here By rolesCategories
- OpenCode: free models, providers and API key
- Cursor + Gonka AI - cheap LLM for coding
- Claude Code + Gonka AI - LLM for the terminal
- DeepSeek Harness: Your Own Provider via JoinGonka Gateway
- Codex CLI: your own key instead of a subscription
- Pi + JoinGonka Gateway — terminal agent on cheap inference
- omp (Oh My Pi) + JoinGonka Gateway: an agent with model roles
- Zoo Code + JoinGonka Gateway: Migrating from Roo Code to Gonka models
- Kilo Code + Gonka AI — AI-Agent in VS Code
- ZCode: GLM Coding Plan tiers, prices and limits
- Hermes Agent + DeepSeek on the Gonka network — an autonomous agent for pennies
- OpenClaw + Gonka AI - affordable AI agents
- 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
- 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
- How Much Does an AI API Cost: Price Comparison per Million Tokens
- How to buy AI tokens and an API key: 3 methods in 2026
- Free AI API: tokens on sign-up and for referrals
- Cursor Pro request limit reached — breakdown and cheaper alternative
- Cheaper Claude Code: GLM and DeepSeek instead of Claude
- Claude Code + DeepSeek V4 Flash: How to Connect It and What a Task Costs
- Cline is burning money — why the agent spends so much
- OpenClaw is expensive — why the agent burns through tokens and how to save
- OpenRouter alternative: the same models, many times cheaper
- 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
- 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
- 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
- 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
- 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
Codex CLI: your own key instead of a subscription
In short: Codex CLI connects to any provider with a Responses API, and you don't need a ChatGPT subscription for that. To JoinGonka — with one command npx @joingonka/setup --tool codex or a [model_providers.joingonka] block in ~/.codex/config.toml with base_url = "https://gate.joingonka.ai/v1" and wire_api = "responses".
Codex CLI is OpenAI's agentic assistant that lives right in your terminal: it reads project files, runs commands in a sandbox, edits code, and explains what it did. Out of the box it talks to OpenAI models via a ChatGPT subscription, but you can swap in your own provider — and then the same scenarios are handled by the Gonka network.
One nuance makes Codex special among agentic tools: it doesn't speak the familiar Chat Completions but the Responses API — OpenAI's new protocol. That's exactly why it used to be impossible to connect it to a third-party gateway. JoinGonka Gateway has accepted Responses since August 22, 2026, and everything below has been verified with a live run, not a retelling of the documentation.
What is Codex CLI and how is it different from chat
Codex isn't an editor autocomplete — it's an autonomous executor. You describe the task in words, and it decides on its own which files to read, which commands to run, and what to change. It has about a dozen tools at its disposal: running commands, reading files, maintaining a work plan, asking the user for clarification, and spawning child agents for subtasks.
Two modes of operation. Interactive — codex with no arguments, a terminal dialogue showing every step. Non-interactive — codex exec "task", a one-off run to completion: handy in scripts and CI.
Safety is built in: by default the agent runs in a sandbox and asks for confirmation before making changes. The level of control is set in the configuration — from "ask about everything" to a fully autonomous run with write access to the working directory.
Another distinguishing feature is conversation state. Codex doesn't ask the server to remember anything: it keeps the entire thread locally and sends it in full with every turn. For you, that means the conversation doesn't linger on the model provider's side, and changing the endpoint doesn't break an ongoing session.
The difference from Claude Code and other terminal agents is precisely the protocol. Codex talks to the model via the Responses API, where the conversation is described not as a flat list of messages but as a stream of items: text, tool call, tool result, reasoning block. For the tool, this yields a stricter dialogue model; for you, it means you need an endpoint that understands this protocol.
Connection: one edit to config.toml
The fast path is the installer. The command npx @joingonka/setup --tool codex will append a provider block to ~/.codex/config.toml with wire_api = "responses", the model and its real context window, preserving your comments and other settings, then verify the key and model with a live request. If another provider is already selected in the config, the installer won't touch it and will suggest a one-off run command. It writes the key directly into the file (permissions 600) in the experimental_bearer_token field — the only one where Codex can store a key literally; Codex itself considers it experimental. The manual option below uses an environment variable instead.
Codex stores settings in ~/.codex/config.toml. A custom provider is described by a [model_providers.*] block, and Codex has only one protocol — the Responses API: wire_api = "responses". Codex no longer accepts the value chat from older instructions.
# ~/.codex/config.toml
model_provider = "joingonka"
model = "deepseek-ai/DeepSeek-V4-Flash-0731"
model_context_window = 380000
[model_providers.joingonka]
name = "JoinGonka Gateway"
base_url = "https://gate.joingonka.ai/v1"
env_key = "JOINGONKA_API_KEY"
wire_api = "responses"The key is not written to the file: env_key names the environment variable from which Codex will read it. The variable name is its own, not OPENAI_API_KEY — this way the setup doesn't intercept your other tools that work with OpenAI.
export JOINGONKA_API_KEY=jg-your-keyThe model field sets the default model, and model_provider picks which of the described blocks to use. Both can be overridden at launch, so a single config can easily serve several providers: production, experimental, and backup. The model_context_window line declares the context window: Codex knows nothing about network models and assumes a window of 272,000 tokens, and it won't go above that value. For DeepSeek V4 Flash and GLM-5.3 Flash this is safe, but for MiniMax M2.7 set 180000 — otherwise the history won't be compacted in time.
The key is issued in your account dashboard after registration, where you can also see your balance and usage. If you prefer not to touch the shared config, the same block can be passed one-off via -c: codex -c model_provider=joingonka …. And to keep several independent configurations, point the CODEX_HOME variable at a settings directory.
Verification: what should happen
The fastest way to confirm the setup works is a one-off run:
codex exec "Answer in one line: what is 17*3?"At the top of the response, Codex prints who it's working with: model, provider: joingonka, the sandbox mode, and the session ID. If your provider is listed there and an answer arrives at the bottom — the connection is live.
Next, check the main thing Codex is installed for — working with files. Put a small file with an obvious bug in the directory and ask it to find the bug:
codex 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, open the file, and answer substantively — pointing to the line. If that happens, the full agent loop (request → tool call → result → answer) through the gateway is working correctly.
If something goes wrong, the diagnosis is usually readable right from the message:
| What you see | What it means | What to do |
|---|---|---|
401 Unauthorized: Invalid API key | Codex didn't find the key or picked the wrong one | Check that the variable from env_key is actually exported in the current shell and its name matches the config |
404 on /responses | The suffix is missing from base_url | The address must end with /v1 — Codex appends /responses itself |
wire_api = "chat" is no longer supported | The provider block still has the value from older instructions: the Chat Completions protocol has been removed from Codex | Set wire_api = "responses" — Codex has no other protocol |
Reconnecting… 1/5 | Codex is retrying the request on its own | Standard behavior for a one-off network error; if retries are exhausted, look at the error text below them |
| A warning about bubblewrap | The system lacks the sandboxing package | Doesn't interfere with operation: Codex will use a built-in copy. For tidiness, install bubblewrap via your package manager |
The first request in a session may take a few seconds: Codex sends a large system prompt and descriptions of all its tools, and the network node needs to accept the task. Subsequent responses come faster.
Which model to choose
Every model on the network costs the same, so the choice comes down to behavior, not budget. Below is the result of a live run of the same task (reading a file and finding a bug in it) through Codex on DeepSeek V4 Flash and MiniMax M2.7; GLM-5.3 Flash joined the network after the run — for it, the model's characteristics are listed.
| Model | ID | Context | How it behaves in Codex |
|---|---|---|---|
| DeepSeek V4 Flash | deepseek-ai/DeepSeek-V4-Flash-0731 | 380K | Clean, to-the-point answers, with the file and line named. One of the longest contexts on the network and a 32768-token response ceiling — headroom for large repositories |
| MiniMax M2.7 | MiniMaxAI/MiniMax-M2.7 | 180K | Solves the task correctly, but sometimes thinks out loud — in the terminal that looks verbose |
| GLM-5.3 Flash | zai-org/GLM-5.3-Flash | 390K | A reasoning model with the longest context on the network: it reasons before every answer, so responses are longer and arrive later. It calls tools, including repeated rounds; for short tasks set reasoning_effort: low |
The default recommendation is DeepSeek V4 Flash: agentic work quickly runs into context limits, and 380K tokens let you keep many files in mind at once. If a task requires thinking through convoluted logic, go with GLM-5.3 Flash, but leave headroom in max_tokens: part of the response budget goes to reasoning. You can switch models with the model line in the config or the -c model=… flag without editing the file; along with it, adjust model_context_window — for MiniMax M2.7 it's 180000.
The current list of network models is always available via GET https://gate.joingonka.ai/v1/models.
How much does it cost
Agent tools consume tokens differently than chat: for each of your phrases, Codex adds a system prompt and a description of all tools, then carries out a multi-step dialog with the model. In a live run, a simple task like "read a file and find an error" cost about 18-20 thousand tokens. This is a normal price to pay for autonomy, which is exactly why the price per token matters.
Via JoinGonka Gateway, tokens cost $0.0062 per million input and $0.019 per million output—the price is identical for all network models and is fetched on this page from a live source.
| Scenario | Consumption | Via Gateway |
|---|---|---|
| One-off task (read file, find error) | ~20K tokens | fractions of a cent |
| Day of active work | 3-7M tokens | about a cent |
| Month of active development | ~150M tokens | a few cents |
For comparison, here is how paid options are structured at Codex itself and among competitors:
| Method | Payment model | Limitations |
|---|---|---|
| ChatGPT Subscription | fixed monthly amount | quotas on number of requests and refresh windows |
| OpenAI key directly | by tokens at vendor price | price per million tokens is three orders of magnitude higher |
| JoinGonka Gateway | by tokens, balance | usage visible in the dashboard, no request quotas |
Payment is for actual consumption, without a monthly subscription or request quotas: no five-hour windows, "prompt" limits, or peak-hour multipliers. The balance is topped up with crypto; the remainder and daily usage are visible in the personal dashboard. A detailed breakdown of the economics is in the article about the cheapest AI API.
What to keep in mind
Codex itself maintains the conversation history. It sends the entire history with every request and does not ask the server to remember anything — and we do not store chat logs. Your code and prompts do not remain on the gateway after a response is provided.
Web search is active. Codex declares a search tool in every request, and the gateway accepts it: the search is performed on our side, and the results are injected into the model's response.
Tools are local, not cloud-based. Codex executes commands and reads files locally on your machine, so access to your project does not depend on the model provider.
Sandbox. On Linux, Codex uses bubblewrap to isolate executed commands. If it is not on your system, Codex will warn you and use a built-in copy — this does not affect performance, but installing the package via your standard package manager is more convenient.
If you need image processing — interface screenshots, diagrams in photos — use a tool with a vision-capable model for such tasks: models in the Gonka network are text-only. This is not a limitation for code, commands, and files.
Other terminal agents, if Codex was not the right fit: the API quickstart shows how to connect any compatible tool in a couple of minutes.
Want to learn more?
Explore other sections or start earning GNK right now.
Get key and free tokens →