TokAPI mascotTokAPICheck Usage
Documentation

Connect your tools to TokAPI

TokAPI is a drop-in gateway for the Anthropic API. Point your editor or CLI at https://api.tokapi.ai, add your key, and keep the workflow you already know.

Setup

Claude Code CLI

Configure the Claude Code CLI to use TokAPI as its API gateway.

Manual configuration

Create or edit ~/.claude/settings.json:

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://api.tokapi.ai",
    "ANTHROPIC_MODEL": "Opus 4.7[1m]",
    "ANTHROPIC_SMALL_FAST_MODEL": "Haiku 4.5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "Sonnet 4.6",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "Opus 4.7[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "Haiku 4.5",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "hasCompletedOnboarding": true
}

Replace YOUR_API_KEY with your actual key, then restart Claude Code.

VS Code

The VS Code Claude extension uses the same configuration as the Claude Code CLI.

For manual setup, use the same files as Claude Code CLI above, then restart VS Code.

Cursor

Configure Cursor to use TokAPI for AI assistance.

API routing

Open Settings → Models → Add OpenAI-compatible model and enter:

config
Base URL:  https://api.tokapi.ai/v1
API Key:   YOUR_API_KEY
Model:     claude-sonnet-4-6

Windsurf

Configure Windsurf to use TokAPI for AI assistance.

API routing

Open Settings → AI Provider and set the base URL:

Base URL
https://api.tokapi.ai/v1

Cline

Configure Cline (the VS Code extension) to use TokAPI.

Manual configuration

Add to your VS Code settings.json:

settings.json
{
  "cline.apiProvider": "anthropic",
  "cline.anthropicBaseUrl": "https://api.tokapi.ai",
  "cline.apiKey": "YOUR_API_KEY"
}

Roo Code

Configure Roo Code (the VS Code extension) to use TokAPI.

Manual configuration

Add to your VS Code settings.json:

settings.json
{
  "roo-cline.apiProvider": "anthropic",
  "roo-cline.anthropicBaseUrl": "https://api.tokapi.ai",
  "roo-cline.apiKey": "YOUR_API_KEY"
}
Reference

Authentication

All proxy endpoints accept API key authentication via either header:

headers
x-api-key: YOUR_API_KEY
# or
Authorization: Bearer YOUR_API_KEY

Dashboard endpoints use JWT tokens obtained from the /auth/login endpoint.

API Reference

All endpoints are relative to https://api.tokapi.ai.

POST/v1/messagesAPI Key

Anthropic-compatible Messages API. Send messages and tools in the standard Anthropic request format; the response matches Anthropic's. Set stream: true to receive Server-Sent Events (message_start, content_block_delta, message_stop). Use Claude model IDs such as claude-opus-4-8 or claude-sonnet-4-6.

POST/v1/responsesAPI Key

OpenAI-compatible Responses API. Provide a model and input; set stream: true to receive Server-Sent Events. Use OpenAI model IDs such as gpt-5.5 or gpt-5.4.

GET/v1/modelsNone

List every model in the catalog with pricing, context limits, and capabilities. Fetch a single model with GET /v1/models/{model}. No authentication required.

Ready to start?

Check your key status, usage, and limits any time.

Check usage