Tool setup

Claude API quickstart: set up and make your first call

This Claude API quickstart takes you from a fresh account to a completed /v1/messages call in minutes. You need exactly three things: one sk-pool key, the router.apitoken.sale base URL, and two HTTP headers. Everything after that is the standard Anthropic Messages API, so the same code runs against the official endpoint unchanged.

·

What a Claude API quickstart actually requires

A working Claude API setup is not a SDK install or a week of onboarding — it is one HTTP POST with two headers. Sign up, generate a key, and send a messages request; the first 2xx usually lands faster than the coffee you made while reading this page. The endpoint speaks the exact Anthropic Messages protocol, which means every tutorial, SDK and coding agent built for Claude already knows how to talk to it.

  • A free account — no approval, no waitlist, no Anthropic account required.
  • One API key (it looks like sk-pool-…) that works across every supported model, including Claude, GPT, Gemini and Kimi.
  • The base URL https://router.apitoken.sale — the single endpoint for new integrations.
  • Two headers on every request: x-api-key with your key, and anthropic-version: 2023-06-01.

See also: Use a Claude API key in Cursor

Create the key and choose your endpoint

  1. 01Sign up with Google, GitHub or email, then open the dashboard — there is no review queue.
  2. 02Generate a key. It is shown once; store it in an environment variable, not in source code.
  3. 03Set your client's base URL to https://router.apitoken.sale and confirm it sends requests to POST /v1/messages.
Base URL:  https://router.apitoken.sale
Endpoint:  POST /v1/messages
Headers:   x-api-key: sk-pool-•••
           anthropic-version: 2023-06-01

The key is live on the next request — there is no activation delay. If your balance is empty, add funds first: top-ups accept any whole-dollar amount, so a single dollar is enough to validate the whole pipeline end to end.

Send the first request with curl

Prove the path with the smallest possible call before wiring anything into an app. max_tokens is mandatory on the Messages API — omitting it is the most common first-call mistake.

curl https://router.apitoken.sale/v1/messages \
  -H "x-api-key: sk-pool-•••" \
  -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"}]
  }'

A successful response is a JSON object whose content field is an array of blocks — for a plain reply, one block of type text. Two fields are worth reading on every call during setup: stop_reason tells you whether the model finished (end_turn) or hit your max_tokens ceiling, and usage reports the exact input_tokens and output_tokens you were billed for. If content comes back empty with stop_reason: max_tokens, raise the limit rather than retrying the same request.

The same call from Python or TypeScript

The official Anthropic SDKs accept a custom base URL, so moving from curl to real code is a one-line override. Model IDs, message shapes, system prompts and tool use all behave exactly as they do against api.anthropic.com.

from anthropic import Anthropic

client = Anthropic(
    base_url="https://router.apitoken.sale",
    api_key="sk-pool-•••",
)
msg = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://router.apitoken.sale",
  apiKey: "sk-pool-•••",
});
const msg = await client.messages.create({
  model: "claude-opus-4-8",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});

Full SDK walkthrough: anthropic-sdk-base-url

Turn on streaming before you build a UI

Anything a human waits on — chat, code completion, an agent loop with visible progress — should stream. Add "stream": true to the same request body and the response becomes Server-Sent Events: a message_start envelope, a sequence of content_block_delta events carrying text fragments, and a message_stop. Your client assembles the fragments; nothing else about the request changes.

curl -N https://router.apitoken.sale/v1/messages \
  -H "x-api-key: sk-pool-•••" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "stream": true,
    "messages": [{"role":"user","content":"Count to five."}]
  }'

Two streaming pitfalls: without -N (or your HTTP client's no-buffer mode) curl buffers the whole SSE body and looks identical to a non-streaming call; and the final usage accounting arrives in the terminal message_delta event, not in a JSON body — read it there if you meter spend per request.

Point your IDE or coding agent at the same key

Because the endpoint is protocol-identical, any tool with an Anthropic provider setting works by changing two fields. In Cursor, for example: Settings → Models → Anthropic API, set the base URL and paste the key, then pick a current model ID.

# Cursor → Settings → Models → Anthropic API
Base URL : https://router.apitoken.sale
API key  : sk-pool-•••
Model    : claude-opus-4-8

The same two-field change covers VS Code extensions such as Cline and Continue, and terminal agents that read ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY from the environment. One key, one prepaid balance, every tool.

Dedicated guide: claude-api-key-for-cursor

Current model lineup and per-model pricing

First-call errors, decoded

Almost every failed first call is one of four statuses. Read the body too — errors come back in the Anthropic error envelope with a message that names the offending field. Gateway limitations add error.details.error_code documented_limitation or unsupported_parameter.

StatusWhat it meansFix
400 Bad RequestMalformed body, unknown model, or a field this endpoint cannot honour (details.error_code documented_limitation / unsupported_parameter)Set max_tokens; use a current model ID such as claude-opus-4-8; omit or relocate the named field
401 UnauthorizedMissing or wrong x-api-key, or the request went to the wrong base URLRe-check the key was pasted in full and the base URL is https://router.apitoken.sale
402 billing_errorThe prepaid balance cannot cover the request — error.type is billing_error, not invalid_request_errorTop up any whole-dollar amount and retry; do not treat 402 as a 429
429 Too Many RequestsConcurrency or rate ceiling hitRespect the Retry-After header and lower concurrency

Frequently asked questions

What base URL do I use for the Claude API quickstart?

Use https://router.apitoken.sale with any Anthropic-compatible tool and send requests to /v1/messages. Existing integrations on the legacy https://api.apitoken.sale host keep working — the unified router is the recommended endpoint for new setups.

Which auth header does the Claude API require?

Send x-api-key with your key and anthropic-version: 2023-06-01, exactly like the official Anthropic API. Do not use Authorization: Bearer on this surface — that header belongs to the OpenAI-compatible lane.

Do I need an Anthropic account or a credit card on file?

No Anthropic account is required — you sign up with Google, GitHub or email and get your own sk-pool key. Balance is prepaid: you top up any whole-dollar amount and it is spent only when requests run.

What is the cheapest way to verify my setup works?

Top up the smallest whole-dollar amount and send one max_tokens: 1 request — a successful 2xx proves auth, endpoint and billing in a single call. New accounts created with Google or GitHub also start with $5 of platform bonus credit, which can cover the test entirely.

Why does my first call return 400 even with a valid key?

Almost always a missing max_tokens field or a model ID that is not enabled — the Messages API rejects requests without max_tokens. Use a current ID such as claude-opus-4-8 and set an explicit token limit.

Can I use the same key for streaming and tool use?

Yes. Streaming is a "stream": true flag on the same request, and tool use follows the standard Anthropic schema — no separate key, plan or endpoint is involved.

Use Google or GitHub to create your key and get $5 of platform bonus credit before you top up.