Getting started

Quick start Authentication

Client setup

Claude Code Python SDK Node SDK Other apps

API reference

Models Messages Error codes

Documentation

Quick start

You need your API key (a UUID) and your 6-digit code set at key creation. Log in at the dashboard or pass the key directly to any client.

Authentication

Pass your key in either header — both are accepted:

x-api-key: YOUR_KEY
Authorization: Bearer YOUR_KEY

Base URL for all requests:

https://api.easytokens.net/

Claude Code

1 — Install

npm install -g @anthropic-ai/claude-code

2 — Set environment variables

# Clear existing credentials first
unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL

export ANTHROPIC_BASE_URL="https://api.easytokens.net/"
export ANTHROPIC_AUTH_TOKEN="your-easytokens-api-key"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5-20251001"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-8"
Note: Claude Code rejects requests when both ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY are set. Unset ANTHROPIC_API_KEY first.
URL suffix: Older Claude Code versions expect the base URL to end in /api/. If you see 404s or "model not found", use https://api.easytokens.net/api/.

3 — Launch

claude

Python SDK

pip install anthropic

import anthropic
client = anthropic.Anthropic(
    api_key="your-easytokens-api-key",
    base_url="https://api.easytokens.net",
)
msg = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content)

Node SDK

npm install @anthropic-ai/sdk

import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
  apiKey: "your-easytokens-api-key",
  baseURL: "https://api.easytokens.net",
});
const msg = await client.messages.create({
  model: "claude-sonnet-4-6",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});
console.log(msg.content);

Other apps

easytokens implements the Anthropic Messages API, so any app that lets you pick an Anthropic provider with a custom base URL works out of the box. Set the base URL to https://api.easytokens.net and use your easytokens key as the Anthropic API key. The endpoint is served on /v1/messages, /api/v1/messages and /messages, so it does not matter how the app joins the base URL and path.

AppWhere to configure
Cline / Roo Code / Kilo CodeSettings → API Provider: Anthropic → enable Use custom base URLhttps://api.easytokens.net, paste your key.
OpenCodeIn opencode.json set the anthropic provider's baseURL to https://api.easytokens.net and apiKey to your key.
Aiderexport ANTHROPIC_API_KEY=your-key and export ANTHROPIC_API_BASE=https://api.easytokens.net, then run with an anthropic/… model.
ZedIn settings.json: "language_models": {"anthropic": {"api_url": "https://api.easytokens.net"}} and set the Anthropic key in the assistant panel.
ContinueAdd an anthropic provider block with apiBase: https://api.easytokens.net and your key.
LibreChatIn librechat.yaml, point the anthropic endpoint's baseURL at https://api.easytokens.net.
OpenAI-format apps: model discovery via GET /v1/models is OpenAI-compatible, but there is no /v1/chat/completions endpoint — clients must speak the Anthropic Messages format. If an app only supports OpenAI providers, it will not work yet.

Available models

Retrieve live via GET /models or GET /v1/models. Base Anthropic per-token prices are listed below.

Model IDNameInput/1MOutput/1MContextFeatures
claude-fable-5Claude Fable 5 $10.00$50.00 1000K vision, tools, cache
claude-opus-4-8Claude Opus 4.8 $5.00$25.00 1000K vision, tools, cache
claude-opus-4-7Claude Opus 4.7 $5.00$25.00 1000K vision, tools, cache
claude-opus-4-6Claude Opus 4.6 $5.00$25.00 1000K vision, tools, cache
claude-opus-4-5-20251101Claude Opus 4.5 $5.00$25.00 200K vision, tools, cache
claude-sonnet-4-6Claude Sonnet 4.6 $3.00$15.00 1000K vision, tools, cache
claude-sonnet-4-5-20250929Claude Sonnet 4.5 $3.00$15.00 200K vision, tools, cache
claude-sonnet-4-5Claude Sonnet 4.5 $3.00$15.00 200K vision, tools, cache
claude-sonnet-4-20250514Claude Sonnet 4 $3.00$15.00 1000K vision, tools, cache
claude-haiku-4-5-20251001Claude Haiku 4.5 $1.00$5.00 200K vision, tools, cache
claude-haiku-4-5Claude Haiku 4.5 $1.00$5.00 200K vision, tools, cache

Messages API

POST https://api.easytokens.net/v1/messages
POST https://api.easytokens.net/api/v1/messages   # legacy alias

Request and response format follows the Anthropic Messages API. Non-streaming responses include a _proxy field with cost and token breakdown. count_tokens is available at the same paths.

Error codes

StatusMeaning
401Missing or invalid API key
402Insufficient balance (balance-type keys)
403Key inactive, frozen, expired, or model not permitted
429Rate cap exceeded — check X-RateLimit-Reset-H4 / X-RateLimit-Reset-H24
502Upstream unreachable