GPT Image 2.5 is live — OpenAI's newest image model, targeted edits that leave the rest of the frame alone
rreAPI Docs

Coding Agents on reAPI

Run Claude Code on reAPI's Claude models and pay with reAPI credits — setup, model mapping, limits and troubleshooting.

Claude Code can use reAPI as its model provider: it talks to reAPI's Anthropic-compatible Messages endpoint with your reAPI API key, and every request is billed to your reAPI credits.

AgentStatus
Claude CodeSupported through https://reapi.ai/api/v1/messages
OpenAI Codex CLINot supported on reAPI — see OpenAI Codex CLI below

To let an agent call reAPI's image, video and audio models instead, use the MCP server or see Use reAPI from AI agents.

Set up Claude Code

Run this in the terminal you start Claude Code from:

export ANTHROPIC_BASE_URL=https://reapi.ai/api
export ANTHROPIC_API_KEY=YOUR_REAPI_API_KEY
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-5-5

claude --model sonnet
  • Base URL ends in /api. Claude Code appends /v1/messages itself; do not use /api/v1 or the full Messages URL.
  • The three ANTHROPIC_DEFAULT_*_MODEL variables map Claude Code's opus, sonnet and haiku aliases (and its background tasks, which use the haiku tier) to reAPI model ids. You can also pass an id directly, for example claude --model claude-haiku-5-5.
  • Prefer a token header? Use ANTHROPIC_AUTH_TOKEN=YOUR_REAPI_API_KEY instead of ANTHROPIC_API_KEY (sent as Authorization: Bearer). Set only one of the two; if both reach reAPI, the x-api-key value from ANTHROPIC_API_KEY wins.

Add the same exports to your shell profile to make them permanent. Setting ANTHROPIC_API_KEY makes Claude Code use the key instead of a claude.ai login for that shell.

Models

Model idUse it for
claude-opus-5-5Hardest tasks, long refactors
claude-sonnet-5-5Everyday coding (good default)
claude-haiku-5-5Fast, low-cost tasks and background work
claude-fable-5, claude-fable-5-1Also available on the Messages endpoint

Prices per million tokens are on each model's page, for example Claude Sonnet 5.5. Other reAPI chat models (GPT, Gemini, Kimi, DeepSeek) are served on the OpenAI-compatible /api/v1/chat/completions endpoint and cannot be selected in Claude Code.

Check the connection

curl -N https://reapi.ai/api/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-haiku-5-5",
    "max_tokens": 32,
    "stream": true,
    "messages": [{"role": "user", "content": "Reply OK."}]
  }'

A working setup streams message_start, content_block_delta and message_stop events.

Credits and limits

  • Requests are billed by tokens after they complete. A new request needs a balance of at least 10 credits ($0.01); below that reAPI answers HTTP 402 Insufficient credits.
  • Up to 20 chat requests can be in flight at once per user, shared by all your keys — enough for Claude Code with subagents, but not for many parallel sessions on one account.
  • The per-user limit of 50 requests per second applies too. Both limits answer HTTP 429 (with Retry-After when reAPI sets the limit).

OpenAI Codex CLI

Recent Codex CLI versions only talk to the OpenAI Responses API, which reAPI does not offer, so reAPI cannot be Codex's model provider. Codex can still call reAPI's image, video and audio models through the MCP server. To run Codex on GPT models with usage-based billing, follow SeedRouter's Codex setup guide. SeedRouter is a separate service: it uses its own account, API key and balance, and reAPI keys and credits do not work there.

Troubleshooting

SymptomFix
401 authentication_errorCheck the key, and that only one of ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN is set.
404 on every requestANTHROPIC_BASE_URL must be https://reapi.ai/api.
400 Unsupported modelUse one of the model ids above; GPT, Gemini and other chat models do not work in Claude Code.
[claude-code:unrecognized_model] printed at startHarmless: Claude Code does not know reAPI's model ids by name. Requests still go through.
A notice about auto mode classifier billingInformational. Auto mode keeps working through reAPI.
402 Insufficient creditsTop up so the balance is at least 10 credits.
429Fewer parallel sessions or subagents; respect Retry-After when present.

Table of Contents