Using the gateway

konata is a drop-in proxy for the Anthropic API. Point any Anthropic-compatible client at https://api.kntalpha.duckdns.org and authenticate with a konata API token.

Quick start

  1. Create an account and add money on the dashboard
  2. Create an API token under API tokens - optionally with a spend limit and expiry
  3. Use it anywhere the Anthropic API works:
curl https://api.konata.ai/v1/messages \
  -H "x-api-key: $KONATA_TOKEN" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Both x-api-key: <token> and Authorization: Bearer <token> are accepted. Usage is billed per token at list prices and deducted from your USD balance.

Anthropic SDK

Official SDKs accept a custom base URL - everything else stays the same.

import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
  baseURL: 'https://api.konata.ai',
  apiKey: process.env.KONATA_TOKEN
});

const message = await client.messages.create({
  model: 'claude-opus-4-8',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello!' }]
});

Claude Code

Set the base URL and auth token in your environment:

export ANTHROPIC_BASE_URL=https://api.konata.ai
export ANTHROPIC_AUTH_TOKEN=knt_sk_...
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
claude

Or persist it in ~/.claude/settings.json (or a project’s .claude/settings.json):

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.konata.ai",
    "ANTHROPIC_AUTH_TOKEN": "knt_sk_...",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

opencode

Override the Anthropic provider in ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://api.konata.ai/v1",
        "apiKey": "{env:KONATA_TOKEN}"
      }
    }
  }
}

Codex

Codex speaks the OpenAI wire format, so it uses the gateway’s OpenAI-compatible endpoint. Add a provider to ~/.codex/config.toml:

model = "claude-opus-4-8"
model_provider = "konata"

[model_providers.konata]
name = "konata"
base_url = "https://api.konata.ai/v1"
env_key = "KONATA_TOKEN"
wire_api = "responses"

Cursor

  1. Open Cursor Settings → Models → API Keys
  2. Paste your konata token into the Anthropic API Key field
  3. Enable Override Anthropic Base URL and set it to https://api.kntalpha.duckdns.org
  4. Verify the key and enable the Claude models you want to use