# Inferris for agents

You are an agent (or a harness) that needs a model backend. Inferris serves open models over
OpenAI- and Anthropic-compatible HTTP APIs. This file tells you how to configure yourself.

## What you need from your human

One Inferris API key. They create it at https://inferris.ai/keys (sign-in required) and put it in
the environment as `INFERRIS_API_KEY`. Never write the key into files that are committed or shared.

## Settings

- OpenAI-compatible base URL: `https://api.inferris.ai/v1`
- Anthropic-compatible base URL: `https://api.inferris.ai`
- Auth header: `Authorization: Bearer $INFERRIS_API_KEY` (`x-api-key` also works on `/v1/messages`)
- Model ID: `glm-5.3`
- List the models the key can call: `GET https://api.inferris.ai/v1/models`
- Context window and max output: not published yet. Do not assume a value.

## Pick your wire format

- You speak Anthropic Messages (Claude Code, Anthropic SDK): `POST /v1/messages`
- You speak OpenAI Responses (Codex CLI): `POST /v1/responses`
- You speak OpenAI Chat Completions (most others): `POST /v1/chat/completions`

Exact config blocks for Claude Code, Codex CLI, OpenCode and OpenAI-compatible tools, plus SDK
examples: https://inferris.ai/developers.md

## Check that it works

```
curl https://api.inferris.ai/v1/chat/completions \
  -H "Authorization: Bearer $INFERRIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "glm-5.3", "messages": [{"role": "user", "content": "Reply with OK."}]}'
```

## When a request fails

- 401: the key is wrong or disabled. Stop and ask your human.
- 403: balance or key quota is used up, or the key may not use this model. Stop and ask your human
  to top up at https://inferris.ai/wallet. Retrying will not help.
- 429: rate limited or at capacity. Wait `Retry-After` seconds if the header is present, otherwise
  back off 1, 2, 4 … up to 30 seconds with jitter.
- 503 and other 5xx: temporary. Retry with backoff; https://inferris.ai/status shows live checks.

Branch on the status code, not on the message text (some messages are in Chinese).
