Rates are the upstream official list price — zero markup, published line by line on pricing→

PixCode documentation

One base URL, two protocols. Change one variable and your coding agent is connected.

Quickstart

Get a key from the console first, then wire it into whichever tool you already use.

QUICK~1 MIN

Get an API key first

Sign in to the console and click "New API key" in the API Keys section. The key is shown once — copy it into the environment variables of any tool below. Logging in with our CLI also issues one automatically.

GUIDED~5 MIN

Full configuration

Set the base URL, the auth header and all three aliases by hand: fast for chores, pro as the default, max for the run that has to land.

TUTORIAL~10 MIN

Run your first real task

Make a multi-file change in a real repository and watch when each alias gets called, and what the bill looks like once cache reads start hitting.

Start the tutorial →

By tool

Pick the one you use and copy it across. Anything not listed works too, as long as it takes a custom endpoint.

Put these in your shell config or the env block of ~/.claude/settings.json. With a custom base URL, Claude Code does not validate model names.

~/.zshrc
export ANTHROPIC_BASE_URL="https://api.pixcode.ai/anthropic"
export ANTHROPIC_AUTH_TOKEN="sk-px-..."
export ANTHROPIC_DEFAULT_OPUS_MODEL="pixcode-max"
export ANTHROPIC_DEFAULT_SONNET_MODEL="pixcode-pro"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="pixcode-fast"
export API_TIMEOUT_MS=3000000

claude

Endpoints & auth

There are only two endpoints. Auth accepts both x-api-key and Authorization: Bearer — use whichever your tool sends. The gateway egresses from Singapore, one less hop to upstream.

Anthropic

https://api.pixcode.ai/anthropic

For tools on the Messages API: Claude Code, Cline, Zed and friends.

OpenAI compatible

https://api.pixcode.ai/v1

For anything that takes a custom OpenAI endpoint; /models lists the catalogue directly.

Minimal request
curl https://api.pixcode.ai/anthropic/v1/messages \
  -H "x-api-key: sk-px-..." \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "pixcode-pro",
    "max_tokens": 1024,
    "messages": [{ "role": "user", "content": "hi" }]
  }'

Model aliases

All three aliases carry 1M context; pick by task length. Assign them by role in your agent config: titles and compaction to the cheap one, the run that has to land to the strong one.

The official names and per-line rates for all 31 models are on the models page. The aliases are just three defaults.

Limits & errors

The concurrency cap stops a few always-on scripts from eating the upstream capacity. When you hit it you get a retry-after — wait for the in-flight requests. A single request is also hard-capped at 780 seconds on the gateway, however generous your client timeout.

402

Out of crystals

Returns 402 with a prompt to get more crystals. No silent fallback to a cheaper model. Top up and it continues.

429

Concurrency exceeded

Each plan caps concurrent agents. Running too many at once returns 429 with retry-after.

GET

Live balance

curl https://api.pixcode.ai/v1/balance -H "x-api-key: sk-px-..."

What should the timeout be?

For long runs, widen the client timeout to 3000000ms (API_TIMEOUT_MS in Claude Code). Agent turns past twenty steps often take minutes on their own, and the default timeout cuts the connection mid-run.

Do I need to do anything for the prefix cache?

No extra parameters. Keep the system prompt and the file context in a stable order; once it hits, repeated context settles at the cache price rather than the input price — the biggest saving in a long session.

Can I use my own upstream key?

Yes. The CLI takes your own upstream key and the proxy is free, permanently. Through the gateway the price matches the vendor’s — the difference is who manages keys and billing.

Connected — now want to know what a turn costs?