Documentation

Coding agents

Step-by-step guides for connecting Claude Code, Codex CLI, Cursor, OpenCode, Cline and other coding agents to RealRelay.ai, with the base URL, key and model each one needs.

Before you start

Every agent on these pages needs the same three things. What differs is where you enter them and which of the two base URL forms the agent takes.

  • An API key. Create one on the API keys page of the console. The guides read it from an environment variable named REALRELAY_API_KEY where the agent supports that; never paste it into a file you commit.

  • A base URL. Agents that speak an OpenAI protocol take the address ending in /v1. Claude Code speaks the Anthropic protocol and takes the address without it, because it appends /v1/messages itself. Each guide states which one it needs.

  • A model ID. Use it exactly as GET /v1/models or the catalog lists it, including the prefix, for example anthropic/claude-sonnet-4-6. See Model IDs.

OpenAI-compatible (Chat Completions, Responses)
https://www.realrelay.ai/v1
Anthropic Messages (Claude Code)
https://www.realrelay.ai

Each guide was checked against the tool's own documentation in the month it shows. These tools change quickly; if a setting is not where a guide says, follow the tool's documentation. Guides marked Experimental have not been run end to end against RealRelay.ai yet.

Choose your agent

Choosing a model

The protocol an agent speaks decides which models it can use well.

  • Anthropic Messages (Claude Code). These Claude models are served natively on /v1/messages:

    • anthropic/claude-opus-5-5
    • anthropic/claude-opus-5
    • anthropic/claude-sonnet-5
    • anthropic/claude-fable-5
    • anthropic/claude-opus-4-8
    • anthropic/claude-opus-4-7
    • anthropic/claude-sonnet-4-6
    • anthropic/claude-opus-4-6
    • anthropic/claude-haiku-5-5
    • anthropic/claude-sonnet-5-5
    • anthropic/claude-fable-5-1
    • anthropic/claude-opus-4-5-20251101
    • anthropic/claude-haiku-4-5-20251001
    • anthropic/claude-sonnet-4-5-20250929

    Other models are reachable through protocol translation, but tool use and extended thinking on them are best effort.

  • OpenAI Responses (Codex CLI). Only models served on /v1/responses work:

    • openai/gpt-5.5-pro
    • openai/gpt-5.4-pro
    • openai/gpt-5.3-codex
    • openai/gpt-5.2-pro
    • openai/gpt-5-pro
    • openai/o1-pro
  • OpenAI Chat Completions (most other agents). Any text model in the catalog. Agents edit files through tool calls, so pick a model that supports tools, with a context window of at least 64K tokens.

Troubleshooting

Each guide has its own troubleshooting section. These causes are common to all of them.

  • 401. The key is in the wrong field or variable, or the variable it refers to is empty in the process that runs the agent. Desktop apps and background services do not see variables exported only in a terminal.

  • 404. The base URL has a doubled or a missing /v1.

  • Model not found. Copy the ID from GET /v1/models, including its prefix.

  • Replies arrive all at once. A proxy between you and the API is buffering the stream. See Streaming.

  • The agent describes edits but makes none. The model does not support tool calling, or not through the protocol the agent speaks. Choose another model.

  • Context errors or early compaction. Set the agent's context window to the model's real limit, shown on the model's catalog page.

Still stuck?

Check the request in the console's usage logs, or contact support with the agent, its version and the error message.