# GLM-5.3 API on InferSpeed: pay per token, no Coding Plan needed

Call `glm-5.3` on InferSpeed and pay per token for what you use, with no plan to buy. One key serves both the OpenAI-compatible and the Anthropic-compatible API, so Claude Code, Codex and OpenCode connect directly.

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

## Prices (USD per 1M tokens)

| Model | Input | Output | Cache read | Official price (input / output) |
|---|---|---|---|---|
| glm-5.3 | $0.84 | $2.64 | $0.156 | $1.40 / $4.40 |
| glm-5.3-flash | $0.09 | $0.30 | $0.018 | $0.15 / $0.50 |

`glm-5.3-flash` is served on Chat Completions (`/v1/chat/completions`) only, so it does not work with Codex.

## Pay per token or the official Coding Plan

InferSpeed bills per token from a prepaid balance; by default each account gets 30 requests per minute and 5 at a time; the APIs are OpenAI-compatible and Anthropic-compatible.

**Which costs less**: if you use a lot every day and can get a plan, the official plan costs less. If your use is uneven, occasional, or you cannot get a plan, paying per token fits better.

## Use it in Claude Code

```bash
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
```

Set every model variable. Otherwise Claude Code asks for its built-in `claude-*` model names; those are routed to `glm-5.3` and billed at its price, but Claude Code's own cost display lists them under the `claude-*` names. You can also write this to `~/.claude/settings.json` with one command:

```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 that 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. Ignore it; it still works.

## Other tools

- Codex CLI: see [/codex](https://inferspeed.ai/codex)
- OpenCode, OpenClaw, Cline and others: see https://inferspeed.ai/developers.md

## FAQ

**Where does GLM come from?**
glm-5.3 is a model released by Z.ai (Zhipu). We serve vendor-released models over more than one route; one route may run the vendor-released FP8 weights on our own hardware (see https://inferspeed.ai/benchmarks.md).

**How long is the context?**
glm-5.3 accepts at least 324,955 prompt tokens in our measurements, with a maximum output of 131,072 (see https://inferspeed.ai/developers.md).

We are the operator of InferSpeed.
