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
- Cheapest AI API: Provider Comparison 2026
- 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
Claude Code + DeepSeek V4 Flash: How to Connect It and What a Task Costs
In short: Claude Code works with DeepSeek without local proxies like claude-code-router. There are two ways to connect: via the official DeepSeek API, which has its own endpoint in Anthropic format, or via JoinGonka Gateway, where the open DeepSeek V4 Flash from the Gonka network responds. In the second case, setup is a single command: npx @joingonka/setup --tool claude-code --model deepseek.
The models differ between the two cases. As of September 10, 2026, the DeepSeek API serves the next version — V4.1 Flash — while V4 Flash, which the Gonka network runs, has been retired from DeepSeek's own API. Below are both setups, how they differ in practice, and what one agent task costs. At prices as of November 2, 2026, a task with 30 model calls costs about $0.09 at DeepSeek during peak hours and about $0.05 the rest of the time; through the gateway, about $0.02.
This isn't Claude, and we won't pretend there's no difference: Anthropic states outright that it does not support running Claude Code with non-Claude models, through any gateway. Technically it all works — we tested Claude Code 2.1.316 with the gateway on November 2, 2026 — but bring your questions to us or to DeepSeek, not to Anthropic support.
Method 1: the official DeepSeek API
DeepSeek offers an Anthropic-format endpoint — https://api.deepseek.com/anthropic — along with an official guide for Claude Code. You create the key in the DeepSeek dashboard (platform.deepseek.com) and top up your balance in advance. Here are the variables from DeepSeek's guide as of November 2, 2026:
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=sk-your-deepseek-key
export ANTHROPIC_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash
export CLAUDE_CODE_EFFORT_LEVEL=max
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=786432
claudeWhat you should know before your first run:
- Model name. As of September 10, 2026,
deepseek-flashis V4.1 Flash, and as of October 17 it's the 1017 update at the same price. DeepSeek still accepts the old namedeepseek-v4-flash, but routes it to the same V4.1 Flash. The[1m]suffix tells Claude Code that the model's context window is 1M tokens, whileCLAUDE_CODE_AUTO_COMPACT_WINDOWsets the threshold at which conversation history gets compacted. - Claude names. If you leave a model named Claude in Claude Code, DeepSeek swaps in its own: names based on
claude-opusget routed to V4 Pro and billed at V4 Pro pricing, while everything else goes todeepseek-flash. That's why the guide pins every alias explicitly. - Peak hours. Since August 16, 2026, DeepSeek charges double on weekdays from 01:00 to 04:00 and from 06:00 to 10:00 UTC, excluding Chinese holidays. In Beijing time that covers almost the entire workday; in Europe it's the morning; in the US it's evening and night.
- Web search. When Claude Code searches the web using its built-in tool, DeepSeek handles the search itself. As of October 31, 2026, this costs money: $0.75 per 1,000 successful queries, plus the tokens the model spends reading what it finds.
Method 2: JoinGonka Gateway — one command
DeepSeek V4 Flash version 0731 runs on the Gonka network — open weights under the MIT license. The gateway accepts Claude Code requests in the Anthropic format (/v1/messages) directly, so no middleware is needed.
Step 1. Key. Sign up at JoinGonka Gateway — new accounts get 3M free tokens — and create a jg-… key in your dashboard.
Step 2. Installer.
npx @joingonka/setup --tool claude-code --model deepseekThe installer will ask for your key, save a copy of ~/.claude/settings.json, and write only its own variables into the env block: the gateway URL and key; the model for the current and new sessions, for the opus, sonnet, fable aliases and for subagents; MiniMax M2.7 for the haiku alias, which Claude Code uses for background tasks; the model's real limits — a 380,000-token window and responses up to 32,768. It leaves your other settings untouched and sets 600 permissions on the key file. At the end, the installer validates the key with a live request. The same installer configures other tools too — there are already 25 of them, including Codex CLI and OpenCode.
Step 3. Verification. Launch claude and open /status: you should see an Anthropic base URL line with the gateway address and an Auth token line with ANTHROPIC_AUTH_TOKEN. Then give it a code task, for example Read calc.py and tell me in one sentence whether it has a bug.
Set up manually
Add the env block to ~/.claude/settings.json — values in this file take precedence over shell export:
{
"env": {
"ANTHROPIC_BASE_URL": "https://gate.joingonka.ai",
"ANTHROPIC_AUTH_TOKEN": "jg-your-key",
"ANTHROPIC_MODEL": "deepseek-ai/DeepSeek-V4-Flash-0731",
"ANTHROPIC_DEFAULT_MODEL": "deepseek-ai/DeepSeek-V4-Flash-0731",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-ai/DeepSeek-V4-Flash-0731",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-ai/DeepSeek-V4-Flash-0731",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "deepseek-ai/DeepSeek-V4-Flash-0731",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMaxAI/MiniMax-M2.7",
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-ai/DeepSeek-V4-Flash-0731",
"CLAUDE_CODE_MAX_CONTEXT_TOKENS": "380000",
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "32768"
}
}The URL goes without /v1: Claude Code appends the /v1/messages path itself. The model name is full and without [1m]: with that suffix Claude Code would assume a 1M-token window, whereas DeepSeek V4 Flash on the network has 380,000. The last two lines declare the real window and response ceiling. If you don't pin the model, Claude Code will send its own claude-* name, and the gateway will respond with the default model — currently GLM-5.3 Flash (zai-org/GLM-5.3-Flash).
All configuration options, including Windows and per-project setups, are in the Claude Code guide.
How DeepSeek and JoinGonka APIs differ in Claude Code
| DeepSeek API | JoinGonka | |
|---|---|---|
| Model | V4.1 Flash, version 1017 | V4 Flash, version 0731 |
| Context window | 1 million tokens | 380K tokens |
| Response up to | 384K tokens | 32,768 tokens |
| Images | reads them | text only |
| Reasoning in the response | yes, in thinking blocks | no |
| Claude Code web search | its own; from 10/31/2026 — $0.75 per 1,000 queries | gateway search |
| Price per token | twice as high during peak hours | one price at any hour |
| Cache | reading from cache is 50 times cheaper than input | all input at a single price |
| More models on the key | V4 Pro | GLM-5.3 Flash, MiniMax M2.7 |
What this means in practice:
- Model version. V4.1 Flash is newer, and by DeepSeek's own benchmarks it's stronger: on Terminal-Bench 2.1, V4.1 Flash scores 90.6 versus 82.7 for V4 Flash 0731 (according to the September 10 and July 31 releases). If you need images, a million-token window, or the very latest version, go with the official DeepSeek API. If what matters more is the price of a large volume of work and one price at any hour, test V4 Flash through the gateway on your own tasks — you can start on free tokens.
- Long sessions. A 380,000-token window holds less history than a million. For everyday work that's enough: the average Claude Code request to DeepSeek V4 Flash through our gateway in October 2026 was about 96K tokens.
For more on the model itself, see the article about DeepSeek V4 Flash on the Gonka network.
What a Claude Code task costs on DeepSeek
First, prices per 1M tokens as of November 2, 2026 — from the DeepSeek pricing page and the OpenRouter API. Next to DeepSeek is the same V4 Flash 0731 from OpenRouter's cheapest providers:
| Where | Model | Input | Cached input | Output |
|---|---|---|---|---|
| DeepSeek API, peak hours | V4.1 Flash | $0.30 | $0.006 | $1.20 |
| DeepSeek API, off-peak | V4.1 Flash | $0.15 | $0.003 | $0.60 |
| OpenRouter, DeepInfra | V4 Flash 0731 | $0.06 | $0.015 | $0.18 |
| OpenRouter, StreamLake | V4 Flash 0731 | $0.132 | $0.0042 | $0.396 |
| JoinGonka Gateway | V4 Flash 0731 | $0.0062 | no separate price | $0.019 |
Our regular input is 24–49 times cheaper than DeepSeek's, and output is 32–65 times cheaper. But reading from cache on DeepSeek costs about the same as our input during peak hours, and half of it off-peak — and Claude Code rereads the same things almost constantly: the system prompt, tool descriptions, and session history. So you have to compare a whole task, not the price per token.
The task. Let's take a task with 30 model calls — say, finding a bug, fixing the code, and running the tests. According to our gateway data for October 2026, a Claude Code request to DeepSeek V4 Flash averages about 96K input tokens and 0.9K output tokens. That makes the task 2.9M input tokens and 27.5K output tokens. Claude Code resends the session at every step, and almost all of it matches the previous request, so let's assume that on DeepSeek and OpenRouter, 95% of the input is read from cache.
| Where | Task | 100 such tasks |
|---|---|---|
| DeepSeek API, peak hours | ~$0.092 | ~$9.20 |
| DeepSeek API, off-peak | ~$0.046 | ~$4.60 |
| OpenRouter, StreamLake — the cheapest provider for this kind of task | ~$0.041 | ~$4.10 |
| OpenRouter, DeepInfra | ~$0.054 | ~$5.40 |
| JoinGonka Gateway | ~$0.018 | ~$1.80 |
The amounts are calculated at prices as of November 2, 2026; our price per token on this page is live and moves with the GNK rate. For a task like this, the gateway comes out about 5 times cheaper than DeepSeek during peak hours, 2.5 times cheaper off-peak, and 2.3 times cheaper than the cheapest provider of the same model on OpenRouter.
The difference depends on the cache. If 98% of the input is read from cache, DeepSeek is about 1.8 times more expensive than us off-peak and 3.7 times during peak hours. If it's 90%, then 3.7 and 7.4 times. With us, the cache share doesn't affect the total: all input costs the same. For a monthly estimate, the GLM-5.3 Flash option, and Claude's own prices for reference, see the article "Claude Code cheaper".
Do you need claude-code-router
Claude Code Router (CCR) is an open-source project under the MIT license: a local gateway running on your machine, by default at http://127.0.0.1:3456. Claude Code and other agents send their requests to it, and it forwards them to the providers you choose: it translates requests between formats (Anthropic Messages, OpenAI Chat and Responses, Gemini), routes tasks to models according to your rules, falls back to a backup model when one fails, and keeps a request log with token counts and cost estimates. It installs as an app for macOS, Windows and Linux or via the command npm install -g @musistudio/claude-code-router (requires Node.js 22 or newer).
For DeepSeek alone you don't need it: DeepSeek has its own Anthropic-format endpoint, and JoinGonka Gateway also accepts Claude Code requests directly. CCR makes sense if you want to:
- keep multiple providers and rules about which task goes where;
- automatically switch to a backup model when the primary one stops responding;
- see a log of requests, tokens and costs in one place;
- connect a provider that only understands the OpenAI format.
CCR connects a custom endpoint using either the Anthropic Messages or OpenAI Chat protocol, and the gateway supports both: the base URL https://gate.joingonka.ai for Anthropic and https://gate.joingonka.ai/v1 for OpenAI. For details, see the Gonka API documentation, section Anthropic Messages.
Which key to put into Claude Code and how to switch back to Claude
Claude Code takes the third-party API key from one of two variables:
ANTHROPIC_AUTH_TOKEN— the key travels in theAuthorization: Bearerheader and works immediately. Both the DeepSeek guide and our installer do it this way.ANTHROPIC_API_KEY— the key travels in thex-api-keyheader; in interactive mode Claude Code will ask once whether to use it.
DeepSeek and JoinGonka accept both headers. As long as the variable with the key is set, your claude.ai subscription isn't used up: Claude Code remembers your login but doesn't send it, and requests are paid from this key's balance. If you set only the URL without a key, Claude Code will send its claude.ai login to the new address, and the request will fail.
Keep the key in ~/.claude/settings.json or in the project's .claude/settings.local.json, but not in the repository's shared .claude/settings.json — that one is usually committed. The installer with the --scope local flag writes to settings.local.json and adds it to .gitignore itself.
To switch back to Claude, remove the lines pointing to DeepSeek or the gateway from the env block and restart Claude Code: it will use your claude.ai login again.
Want to learn more?
Explore other sections or start earning GNK right now.
Get a key and free tokens →