Knowledge Base Sections ▾

Tools

Tools

Claude Code + Gonka AI - LLM for the terminal

Claude Code is a powerful AI assistant for development right in your terminal. It works with Git, file system, runs tests, refactors code. But native Claude Sonnet 4.6 costs $3-15 per 1M tokens, and with active work, the weekly bill can exceed $200.

JoinGonka Gateway supports native Anthropic API (/v1/messages) — Claude Code connects directly, without a proxy. The Qwen3-235B model through the decentralized Gonka network for $0.001/1M tokens — thousands of times cheaper, with comparable quality on coding tasks.

Setup takes 2 minutes — two environment variables.

Step 1: Get API Key

If you don't have a JoinGonka Gateway key yet:

  1. Register at gate.joingonka.ai/register.
  2. Get a bonus of 10M free tokens.
  3. Create an API key in Dashboard → API Keys.
  4. Copy the key (format: jg-xxx).

One key works with any OpenAI-compatible tool: Cursor, Aider, LangChain, etc.

Step 2: Connect Claude Code

JoinGonka Gateway natively supports Anthropic Messages API (/v1/messages) — no proxy needed.

Automatic setup (1 command):

npx @joingonka/claude-code

The installer will ask for your API key and save the settings to Claude Code. More details: GitHub.

Or manually — using two environment variables:

export ANTHROPIC_BASE_URL=https://gate.joingonka.ai
export ANTHROPIC_API_KEY=jg-your-key
claude

That's it. Claude Code will send requests to JoinGonka Gateway in the native Anthropic format. The Gateway converts them into requests to the Gonka network and returns the response in Anthropic format.

What is supported:

  • Streaming — the response starts appearing immediately (SSE in Anthropic format: message_start, content_block_delta, message_stop)
  • Tool calling — Claude Code actively uses functions for working with files and commands. Native tool calling via Qwen3-235B.
  • System prompts — system prompts are passed as is

Verification: In Claude Code, ask any question. If an answer appears, it's working.

For Windows/PowerShell:

$env:ANTHROPIC_BASE_URL="https://gate.joingonka.ai"
$env:ANTHROPIC_API_KEY="jg-your-key"
claude

Cost Comparison with Anthropic

Claude Code is one of the most "greedy" AI tools: it sends the full context of files, command history, and diffs. A typical session consumes 20-50M tokens.

ProviderModelInput/Output Price per 1M4h session (~30M tokens)Month (20 working days)
JoinGonkaQwen3-235B$0.001 / $0.001$0.03$0.60
AnthropicClaude Sonnet 4.6$3.00 / $15.00$210$4,200
OpenAIGPT-5.5$5.00 / $30.00$300$6,000

The difference is three-four orders of magnitude. For $0.60 a month through JoinGonka, you get what costs $4,200+ with Anthropic. For an indie developer, this is the difference between "I can afford an AI assistant" and "I can't."

Usage Tips

A few recommendations for effective work with Claude Code via Gonka:

  • Context: Qwen3-235B has a 128K token context window (~100K words) — enough for most projects. The maximum response length through the Gateway is up to 8192 tokens (Qwen3-235B; Kimi K2.6 – 3072, MiniMax M2.7 – 4096). For long generations, it might be necessary to break the task into parts. Model specifications: HuggingFace.
  • Streaming: The Gateway supports streaming in native Anthropic format — the response starts to display immediately, just like with native Claude.
  • Tool calling: Qwen3-235B supports native tool calling, which is important for Claude Code — the tool actively uses functions for working with files and commands.
  • Latency: The first request might take 5-10 seconds (cold start of the node). Subsequent requests take 1-3 seconds.
  • Other tools: JoinGonka Gateway is also compatible with OpenAI API — Aider, OpenCode, Cursor connect via /v1/chat/completions.

For developers who prefer other terminal tools, see also: Aider, OpenCode.

Claude Code + Gonka = powerful terminal AI assistant for ~$0.60/month instead of $4,200 from Anthropic. Direct connection via Anthropic API — no proxy, 2 variables, 2 minutes. 10M free tokens to start.

Want to learn more?

Explore other sections or start earning GNK right now.

Get 10M free tokens →