Knowledge Base Sections ▾

Navigation

▸ Start here By roles

Categories

Tools 36
Glossary 12

pi.tag

Pi + JoinGonka Gateway — terminal agent on cheap inference

Pi is a minimalist terminal coding agent, one of the fastest-growing open harnesses of 2026. Providers are described declaratively in ~/.pi/agent/models.json, and any endpoint that speaks OpenAI Completions or Anthropic Messages works — meaning JoinGonka Gateway connects via both paths. Gonka decentralized network models cost hundreds of times less than vendor card prices, and the starting 10M tokens are free.

Fast path: installer

The quickest option is our installer:

npx @joingonka/setup --tool pi

It will configure a provider with current network models in ~/.pi/agent/models.json, set the default model in ~/.pi/agent/settings.json (without overwriting existing choices), and perform a live request to verify that the gateway accepts the key and model. The key is stored as a literal in the config with 0600 permissions — there is no need to export an environment variable.

Manual configuration: provider in models.json

Get a jg-… key upon registration and add the provider to ~/.pi/agent/models.json:

baseUrlhttps://gate.joingonka.ai/v1
apiopenai-completions
apiKeyyour jg-… key as a literal. Pi understands $VAR/${VAR} links and !command, but the literal works without an exported variable — keep the file with 0600 permissions
modelsarray: id, name, contextWindow, maxTokens

Correct values for network models: deepseek-ai/DeepSeek-V4-Flash-0731 — contextWindow 380000, maxTokens 32768; moonshotai/Kimi-K2.6 and MiniMaxAI/MiniMax-M2.7 — maxTokens 8192. Pi defaults (128000/16384) do not match actual network limits, so set both fields explicitly. The default model resides in a DIFFERENT file — ~/.pi/agent/settings.json, fields defaultProvider and defaultModel. Verification: pi --list-models should show the added models.

Anthropic path as an alternative

The gateway also provides Anthropic Messages: a provider with api: "anthropic-messages" and baseUrl: "https://gate.joingonka.ai" — without the /v1/messages path, the client will append it itself. For daily work, the OpenAI path is sufficient; the Anthropic option is useful if your Pi extensions are tuned for the Messages format.

Safety disclaimer

Pi does not have a full permission layer by default: the agent executes commands in the terminal without the step-by-step confirmation found in heavier harnesses. Run it in a sandbox — a container or a separate user account — especially for autonomous multi-step tasks. This is a property of Pi itself, not the gateway.

Which model to choose and pricing

All three network models support tool calling and streaming. For long sessions and large repositories, use DeepSeek V4 Flash (longest network context, output up to 32768). Kimi K2.6 is strong in multi-step agent work, while MiniMax M2.7 is a versatile option. There is a single rate; real-time pricing is available in the gateway pricing list.

Pi connects to the JoinGonka Gateway with a single entry in ~/.pi/agent/models.json: baseUrl gate.joingonka.ai/v1, api openai-completions, key as a literal, and models with accurate contextWindow/maxTokens. Even faster: use npx @joingonka/setup --tool pi. Run the agent in a sandbox and start with 10M free tokens.

Want to learn more?

Explore other sections or start earning GNK right now.

pi.cta.text →