# AgentRouter — Overview > Base Sepolia testnet. Wallet setup and spending require the owner's authorization. Follow one wallet path. Discover the available models and use your purchased key with OpenAI- or Anthropic-compatible requests. [Human guide](https://docs.agentrouter.cc/use/inference) · [Pricing](https://agentrouter.cc/pricing#agents) · [Documentation index](https://docs.agentrouter.cc/llms.txt) ## Using your key The steps after purchasing a key are the same for both wallets. Keep the key private and follow one of the shared API guides. - [Discover models](https://docs.agentrouter.cc/use/models) — read the public catalog. - [OpenAI-compatible API](https://docs.agentrouter.cc/use/openai) — use the completion interface. - [Anthropic-compatible API](https://docs.agentrouter.cc/use/anthropic) — use the messages interface. Need a key first? Follow the [MetaMask](https://docs.agentrouter.cc/wallets/metamask) or [Coinbase](https://docs.agentrouter.cc/wallets/coinbase) wallet guide. For setup or request problems, see [Troubleshooting](https://docs.agentrouter.cc/troubleshooting). ## Discover models # Read the public model catalog No authentication or payment is required. HTTP 200 returns a JSON array, not an OpenAI object/list envelope; an empty array is valid. Each model has `id`, `protocols`, `context_length`, `max_output_tokens`, `input_per_1m`, and `output_per_1m`. Prices are USD per **million** tokens as decimal strings. Optional fields include aliases, cache prices, and `free`. Use an offered model with the desired protocol; do not copy old fixture prices. On HTTP 429, respect `Retry-After`. Browser cross-origin access requires verified CORS. ```sh curl -sS https://api.agentrouter.cc/v1/models ``` ### Expected result ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "HTTP 200 public model catalog body", "type": "array", "items": { "type": "object", "required": ["id", "input_per_1m", "output_per_1m", "context_length", "max_output_tokens", "protocols"], "properties": { "id": { "type": "string" }, "aliases": { "type": "array", "items": { "type": "string" } }, "input_per_1m": { "type": "string" }, "output_per_1m": { "type": "string" }, "cache_read_per_1m": { "type": "string" }, "cache_write_per_1m": { "type": "string" }, "free": { "type": "boolean" }, "context_length": { "type": "integer" }, "max_output_tokens": { "type": "integer" }, "protocols": { "type": "array", "items": { "type": "string", "enum": ["openai", "anthropic"] } } } } } ``` ## OpenAI-compatible inference # Run OpenAI-compatible inference with a purchased key Verify `zai/glm-5.3` is offered with `openai` in the current catalog before spending. Set `AGENTROUTER_KEY` privately. Create **one** identity per intended request; retain it and the exact body for retries. Do not rerun `uuidgen` to bypass an uncertain result. Purchased keys do not support streaming. HTTP 200 returns an OpenAI-compatible completion. Replays return request status, not the original completion. HTTP 401 means an invalid key; 402 means allowance exhausted. Do not create a fresh identity after an uncertain charge. ```sh REQUEST_ID=$(uuidgen) curl -sS https://api.agentrouter.cc/v1/chat/completions \ -H "Authorization: Bearer ${AGENTROUTER_KEY:?set your key privately}" \ -H "Idempotency-Key: $REQUEST_ID" \ -H 'Content-Type: application/json' \ -d '{ "model": "zai/glm-5.3", "max_tokens": 512, "reasoning_effort": "low", "stream": false, "messages": [{ "role": "user", "content": "Reply with exactly OK." }] }' ``` ### Expected result # Expected inference result HTTP 200 returns an OpenAI-compatible completion, with the answer in `choices[0].message.content` and token counts in `usage`. The tested request returned `OK`; model output can vary. A 200 status with no visible answer is not proof of a useful reply. Keep the request identity if the result is uncertain; do not create a new billable request automatically. ## Anthropic-compatible inference # Run Anthropic-compatible inference with a purchased key Verify `zai/glm-5.3` is offered with `anthropic` in the current catalog before spending. Set `AGENTROUTER_KEY` privately. Retain this identity and exact body for retries; generate another identity only for a genuinely new intended request. HTTP 200 returns an Anthropic-compatible messages object. Purchased keys do not support SSE. Replays return request status, not the original completion. Do not create a fresh identity after an uncertain charge. The native `x-api-key` header is also supported. ```sh REQUEST_ID=$(uuidgen) curl -sS https://api.agentrouter.cc/v1/messages \ -H "Authorization: Bearer ${AGENTROUTER_KEY:?set your key privately}" \ -H "Idempotency-Key: $REQUEST_ID" \ -H 'Content-Type: application/json' \ -H 'anthropic-version: 2023-06-01' \ -d '{ "model": "zai/glm-5.3", "max_tokens": 512, "stream": false, "messages": [{ "role": "user", "content": "Reply with exactly OK." }] }' ``` ### Expected result # Expected inference result HTTP 200 returns an Anthropic-compatible message with content and usage. Output can stop at the requested token limit; a successful HTTP response does not guarantee the requested phrase. Purchased keys use non-streaming responses. Retain the request identity after a timeout or uncertain charge. A replay returns request status, not the original completion; do not generate a new identity merely to retry an uncertain result.