> For AI agents: step-by-step setup guide — [`/docs/agents.md`](https://gate.joingonka.ai/docs/agents.md), documentation index — [`/llms.txt`](https://gate.joingonka.ai/llms.txt).

# Connect Gonka models to your tool

OpenAI- and Anthropic-compatible API. Pick your tool — get the install command, an agent prompt, and a verification step.

## Quick facts

- Base URL for OpenAI API clients: `https://gate.joingonka.ai/v1`
- Base URL for Anthropic API clients, without `/v1`: `https://gate.joingonka.ai`
- The key is passed in the `Authorization: Bearer jg-…` or `x-api-key: jg-…` header
- List of available models: `GET https://gate.joingonka.ai/v1/models`
- Recommended model: `MiniMaxAI/MiniMax-M2.7`

## Connect a tool

Pick your tool — below are three steps tailored to it. The installer configures the tools in the table below (25 of them) with a single command; the rest are connected via a guide.

### Key

Sign up at [gate.joingonka.ai](https://gate.joingonka.ai/register) and create a key in your dashboard. Right after signing up, 3M free tokens land in your account.

### Connection

The installer configures the tool on its own: it prompts for the key with hidden input, writes the config, and verifies the connection. The value for `--tool` is in the tool table below.

```bash
npx -y @joingonka/setup --tool <id> --model MiniMaxAI/MiniMax-M2.7
```

Or delegate the setup to an AI agent — send it this prompt:

```text
Connect your tool to JoinGonka Gateway — the OpenAI- and Anthropic-compatible API of the Gonka network — following the instructions at https://gate.joingonka.ai/docs/agents.md. I'll provide the key myself: don't save it in repository files and don't modify global environment variables. At the end, verify the connection with a short request and report the result.
```

Step-by-step guides for each tool are linked in the table below.

### Verification

Account balance — this request doesn't spend tokens:

```bash
curl -s https://gate.joingonka.ai/api/balance \
  -H "Authorization: Bearer $JOINGONKA_API_KEY"
```

A short request to the model — a 200 response means everything is set up:

```bash
curl -s https://gate.joingonka.ai/v1/chat/completions \
  -H "Authorization: Bearer $JOINGONKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "MiniMaxAI/MiniMax-M2.7", "messages": [{"role": "user", "content": "Say OK"}], "max_tokens": 32}'
```

### All tools

| Tool | Type | Installer |
| --- | --- | --- |
| [Cursor](https://joingonka.ai/en/knowledge/cursor/) | IDE | `--tool cursor` |
| [Claude Code](https://joingonka.ai/en/knowledge/claude-code/) | CLI agent | `--tool claude-code` |
| [OpenClaw](https://joingonka.ai/en/knowledge/openclaw/) | CLI agent | `--tool openclaw` |
| [OpenCode](https://joingonka.ai/en/knowledge/opencode/) | CLI agent | `--tool opencode` |
| [Continue](https://joingonka.ai/en/knowledge/continue-dev/) | IDE | `--tool continue` |
| [Cline](https://joingonka.ai/en/knowledge/cline/) | IDE | `--tool cline` |
| [Aider](https://joingonka.ai/en/knowledge/aider/) | CLI agent | `--tool aider` |
| [LangChain](https://joingonka.ai/en/knowledge/langchain/) | Framework | — |
| [n8n](https://joingonka.ai/en/knowledge/n8n/) | Framework | — |
| [Open WebUI](https://joingonka.ai/en/knowledge/open-webui/) | Chat | — |
| [LibreChat](https://joingonka.ai/en/knowledge/librechat/) | Chat | — |
| [Hermes](https://joingonka.ai/en/knowledge/hermes/) | CLI agent | `--tool hermes` |
| [Kilo Code](https://joingonka.ai/en/knowledge/kilo-code/) | IDE | `--tool kilo` |
| [Roo Code](https://joingonka.ai/en/knowledge/roo-code/) | IDE | `--tool roo` |
| [LlamaIndex](https://joingonka.ai/en/knowledge/llamaindex/) | Framework | — |
| [PydanticAI](https://joingonka.ai/en/knowledge/pydantic-ai/) | Framework | — |
| [Vercel AI SDK](https://joingonka.ai/en/knowledge/vercel-ai-sdk/) | Framework | — |
| [TanStack AI](https://joingonka.ai/en/knowledge/tanstack-ai/) | Framework | — |
| [ZCode](https://joingonka.ai/en/knowledge/zcode/) | CLI agent | `--tool zcode` |
| [JetBrains](https://joingonka.ai/en/knowledge/jetbrains/) | IDE | `--tool jetbrains` |
| [Copilot BYOK](https://joingonka.ai/en/knowledge/copilot-byok/) | IDE | `--tool copilot-byok` |
| [Zed](https://joingonka.ai/en/knowledge/zed/) | IDE | `--tool zed` |
| [Pi](https://joingonka.ai/en/knowledge/pi/) | CLI agent | `--tool pi` |
| [Codex CLI](https://joingonka.ai/en/knowledge/codex/) | CLI agent | `--tool codex` |
| [DeepSeek Harness](https://joingonka.ai/en/knowledge/deepseek-harness/) | CLI agent | — |
| [MiniMax Code](https://joingonka.ai/en/knowledge/minimax-code/) | CLI agent | `--tool minimax-code` |
| [Warp](https://joingonka.ai/en/knowledge/warp/) | CLI agent | — |
| [Trae](https://joingonka.ai/en/knowledge/trae/) | IDE | — |
| [Cherry Studio](https://joingonka.ai/en/knowledge/cherry-studio/) | Chat | — |
| [omp (Oh My Pi)](https://joingonka.ai/en/knowledge/omp/) | CLI agent | `--tool omp` |
| [OpenHands](https://joingonka.ai/en/knowledge/openhands/) | CLI agent | — |
| [Qwen Code](https://joingonka.ai/en/knowledge/qwen-code/) | CLI agent | `--tool qwen-code` |
| [Goose](https://joingonka.ai/en/knowledge/goose/) | CLI agent | `--tool goose` |
| [Crush](https://joingonka.ai/en/knowledge/crush/) | CLI agent | `--tool crush` |
| [Zoo Code](https://joingonka.ai/en/knowledge/zoo-code/) | IDE | `--tool zoo` |
| [Kimi Code](https://joingonka.ai/en/knowledge/kimi-code/) | CLI agent | `--tool kimi-code` |
| [Factory Droid](https://joingonka.ai/en/knowledge/factory-droid/) | CLI agent | `--tool droid` |
| [MiMo Code](https://joingonka.ai/en/knowledge/mimo-code/) | CLI agent | `--tool mimo-code` |

## Code examples

The same request via the OpenAI SDK, cURL, and the Anthropic SDK. The key is read from the `JOINGONKA_API_KEY` environment variable.

### Python

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://gate.joingonka.ai/v1",
    api_key=os.environ["JOINGONKA_API_KEY"],
)

response = client.chat.completions.create(
    model="MiniMaxAI/MiniMax-M2.7",
    messages=[{"role": "user", "content": "What is Gonka?"}],
)
print(response.choices[0].message.content)
```

### TypeScript

```typescript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://gate.joingonka.ai/v1",
  apiKey: process.env.JOINGONKA_API_KEY,
});

const response = await client.chat.completions.create({
  model: "MiniMaxAI/MiniMax-M2.7",
  messages: [{ role: "user", content: "What is Gonka?" }],
});
console.log(response.choices[0].message.content);
```

### cURL

```bash
curl https://gate.joingonka.ai/v1/chat/completions \
  -H "Authorization: Bearer $JOINGONKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMaxAI/MiniMax-M2.7",
    "messages": [{"role": "user", "content": "What is Gonka?"}]
  }'
```

### Anthropic SDK

```python
import os
import anthropic

client = anthropic.Anthropic(
    base_url="https://gate.joingonka.ai",
    api_key=os.environ["JOINGONKA_API_KEY"],
)

message = client.messages.create(
    model="MiniMaxAI/MiniMax-M2.7",
    max_tokens=1024,
    messages=[{"role": "user", "content": "What is Gonka?"}],
)
print(message.content[0].text)
```

## Documentation sections

- [API](https://gate.joingonka.ai/docs/api) — Reference for the OpenAI- and Anthropic-compatible API to Gonka network models: keys, parameters, streaming, tools, plugins. Free tokens when you sign up.
- [Models](https://gate.joingonka.ai/docs/models) — Gonka network models in a single API: id for the model field, context, output limit, pricing, and status. The same open models at a fraction of the cost.
- [Errors & Rate Limits](https://gate.joingonka.ai/docs/errors) — Gateway error codes, request limits, and timeouts: what each response means and when to retry your request.
- [Pricing & Account](https://gate.joingonka.ai/docs/billing) — Gonka network models priced per token: free tokens to start, top up with GNK, USDT, or a card, all fees out in the open, and an account API to track your spending.
- [For Agents](https://gate.joingonka.ai/docs/agents) — Hand the link to your AI agent and it will connect Claude Code, Cursor, or Codex to Gonka network models on its own: ready-made prompt, guide, and skill.
