# InferSpeed > InferSpeed is a pay-per-token model API with OpenAI- and Anthropic-compatible endpoints at https://api.inferspeed.ai, billed from a prepaid balance. Any agent harness that lets you set a base URL can use it. Models on sale and live prices: https://inferspeed.ai/model-plaza (JSON: https://inferspeed.ai/api/v1/public/pricing). The web app at https://inferspeed.ai is a JavaScript single-page app. The files below are plain text and readable without JavaScript. ## Settings - OpenAI-compatible base URL: `https://api.inferspeed.ai/v1` (clients append `/chat/completions` or `/responses`) - Anthropic-compatible base URL: `https://api.inferspeed.ai` (clients append `/v1/messages`; do not add `/v1` or any other path to it) - API key: read it from the environment variable `INFERSPEED_API_KEY`; send it as `Authorization: Bearer $INFERSPEED_API_KEY` (`x-api-key` also works) - Other wire formats on the same host and key: legacy `POST /v1/completions`; Gemini native `POST /v1beta/models/{model}:generateContent`, `:streamGenerateContent`, `:countTokens` (key via `x-goog-api-key`, Bearer or `?key=`). - Models: every public model ID is listed at https://inferspeed.ai/api/v1/public/pricing (`data.models[].id`). One API key calls every live model (`GET https://api.inferspeed.ai/v1/models` lists them); name the model in the request. - Use only the two base URLs above; there is no other API version or host (no `/v2`, no `/v3`). ## API - [API page (Markdown)](https://inferspeed.ai/developers.md): base URLs, auth, model ID, endpoints, copy-paste setup for Codex CLI, Claude Code, OpenCode, OpenClaw and OpenAI-compatible tools, SDK examples, errors and retries - [Agent setup](https://inferspeed.ai/agents.md): short instructions for an agent configuring itself to use InferSpeed - [Agent skill](https://inferspeed.ai/skill.md): base URLs, auth, model and price discovery, connection test, balance and usage, errors, and safety rules for handling the key - [Installer](https://inferspeed.ai/setup.sh): `curl -fsSL https://inferspeed.ai/setup.sh | sh -s -- [--model ] [--dry-run]`; reads the key from INFERSPEED_API_KEY, shows a diff and backs up before writing one config file - [Prices (JSON)](https://inferspeed.ai/api/v1/public/pricing): USD per 1M tokens per model, no key needed - Vendor list prices: the pricing JSON publishes each model's vendor list price next to ours (`list_price`, present when known), so the two can be compared per model - Right now every model that has a vendor list price is 40% below it (the smaller of the input and output savings, rounded down; computed from the pricing JSON when this file was served) - Top up (agents): when the balance is low, call `POST https://inferspeed.ai/api/v1/billing/topup` with the API key and `{"amount_usd": 10}`, and give the returned payment URL to your user; details in [skill.md](https://inferspeed.ai/skill.md) ## Setup guides - [Codex CLI (Chinese)](https://inferspeed.ai/codex.md): configure Codex CLI with InferSpeed as a third-party API, common errors, live prices (page: https://inferspeed.ai/codex) - [GLM API, pay per token (Chinese)](https://inferspeed.ai/glm.md): glm-5.3 and glm-5.3-flash prices and Claude Code setup (page: https://inferspeed.ai/glm) - [Run Claude Code on GLM-5.3](https://inferspeed.ai/claude-code.md): Claude Code setup, live prices and limits (page: https://inferspeed.ai/claude-code) - [Claude Agent SDK on GLM-5.3](https://inferspeed.ai/claude-agent-sdk.md): Claude Agent SDK setup (TypeScript and Python), model routing, live prices and limits (page: https://inferspeed.ai/claude-agent-sdk) - [OpenAI Agents SDK on GLM-5.3 or Kimi K3](https://inferspeed.ai/openai-agents-sdk.md): OpenAI Agents SDK setup (Python), model routing, live prices and limits (page: https://inferspeed.ai/openai-agents-sdk) - [Everything in one file](https://inferspeed.ai/llms-full.txt): this index followed by developers.md, agents.md and skill.md ## Not supported - Models that are not on sale. One key calls every live model (each request is billed at the price of the model that served it; the key's spend limit, rate limits and IP allowlist apply to every model), but a model that is not on sale returns 404 `model_coming_soon` or `model_not_found` (agent default names such as `claude-*` and `gpt-*` are routed to a live model instead; see "Model routing" in developers.md). - Hosted tools such as web search are not executed by the gateway (in Codex CLI set `web_search = false`). - Above the default limits: 30 requests per minute and 5 concurrent requests per account, across all keys of the account. Over the limit you get HTTP 429 (`Retry-After` on `rate_limit_exceeded`); see https://inferspeed.ai/docs#rate-limits. - `glm-5.3-flash` is served on `POST /v1/chat/completions` only (not Responses or Messages). - No other API version or host: no `/v2`, no `/v3`. ## Optional - [Quickstart](https://inferspeed.ai/docs): the same setup for people - [Rate limits](https://inferspeed.ai/rate-limits): default limits and what happens when you exceed them - [Models and pricing](https://inferspeed.ai/model-plaza) - [Status](https://inferspeed.ai/status)