# Run Claude Code on GLM-5.3 with InferSpeed

Point Claude Code at InferSpeed's Anthropic-compatible endpoint and set the model to `glm-5.3`. You keep Claude Code's tools and workflow and pay per token from a prepaid balance. No subscription required.

Last checked: 2026-10-18 (the date the site re-verified this config) · Claude Code 2.1.302

## Setup

```bash
export INFERSPEED_API_KEY="sk-****"   # create one at https://inferspeed.ai/keys
export ANTHROPIC_BASE_URL="https://api.inferspeed.ai"
export ANTHROPIC_AUTH_TOKEN="$INFERSPEED_API_KEY"
export ANTHROPIC_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_SONNET_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_FABLE_MODEL="glm-5.3"
export CLAUDE_CODE_SUBAGENT_MODEL="glm-5.3"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
claude
```

Keep the model variables. Without them Claude Code asks for its built-in `claude-*` names; those are routed to `glm-5.3`, but Claude Code's own cost display then lists them under the `claude-*` name.

Or write it into `~/.claude/settings.json` with the installer (it shows a diff and backs up first):

```bash
curl -fsSL https://inferspeed.ai/setup.sh | sh -s -- claude --model glm-5.3 --dry-run
curl -fsSL https://inferspeed.ai/setup.sh | sh -s -- claude --model glm-5.3
```

## Check it works

```bash
claude -p "reply with the word ok"
```

In `-p` mode Claude Code may print `unrecognized_model` for `glm-5.3` on stderr; it still works.

## Price (USD per 1M tokens)

| Model | Input | Output | Cache read | Vendor list price (in / out) |
|---|---|---|---|---|
| glm-5.3 | $0.84 | $2.64 | $0.156 | $1.40 / $4.40 |
| kimi-k3 | $1.80 | $9.00 | $0.18 | $3.00 / $15.00 |

Live prices for every model: https://inferspeed.ai/model-plaza

## Where the model comes from

glm-5.3 is published by Z.ai. It is served from the vendor's published model through more than one route; a route may run the vendor's FP8 weights on our own hardware. Vendor-reported scores and our own measurement method: https://inferspeed.ai/benchmarks.md

## Limits

- One key calls every live model (`glm-5.3`, `kimi-k3`, ...): name the model in the request. Each request is billed at the price of the model that served it.
- Default: 30 requests per minute and 5 concurrent requests per account.
- Hosted tools such as web search are not executed by the gateway.

## FAQ

**How do I go back to my previous setup?**
Unset the variables. If you used the installer, it copied your old `~/.claude/settings.json` to `<file>.bak-<timestamp>` before writing.

**How do I check what I was charged?**
Call `GET https://api.inferspeed.ai/v1/usage` with your key: it returns today's and total tokens and `actual_cost`. How we check billing (charged amount equals billed tokens × published price) and how to run that check yourself: https://inferspeed.ai/benchmarks.md

We run InferSpeed.
