Skip to content
Modeless
IntegrationsSet up

Set up your agent in a few minutes

Pick your tool, create a key and paste in the settings. If you write your own code, the API basics are further down.

01Your agent

Pick your tool

Using a tool that isn't listed? Any client that speaks one of the three protocols below works with the same settings.

Anthropic Messagesrecommended: auto
  1. Create an API key

    Sign up at modeless.ai and create a key in the console.

  2. Point Claude Code at Modeless

    Add these to your shell profile, then open a new terminal.

    bash
    export ANTHROPIC_BASE_URL="https://api.modeless.ai"
    export ANTHROPIC_AUTH_TOKEN="<your-modeless-key>"
    export ANTHROPIC_MODEL="auto"
  3. Check it works

    Run claude and send one message. /status shows the Modeless base URL.

    • · Routing survives context compaction: the session keeps its model.
    • · Sub-agents get their own routing state, separate from the parent.

02API basics

For code you write yourself

Modeless accepts three API formats unchanged. Change the base URL and the model name, and your existing client keeps working.

Base URL

https://api.modeless.ai

Add /v1 for OpenAI clients. Anthropic clients take the bare host.

Authentication

Your Modeless key, as Authorization: Bearer or x-api-key, the way your SDK already sends it.

Endpoints

POST /v1/chat/completions
OpenAI Chat Completions
POST /v1/messages
Anthropic Messages
POST /v1/responses
OpenAI Responses

JSON or SSE streaming on all three.

Models

auto
picks the model as the session goes
fusion
panel plus aggregator

Sessions

Auto treats each conversation as one session. If you build your own agent, send X-Session-ID with a stable id per task. Without it, Auto recognizes a session by its first user message. Claude Code's own session header is read automatically.

Errors

Errors come back in the format of the protocol you called, so your SDK's error handling works unchanged. With Auto, a request too large for every model's context window returns 400.

python
from openai import OpenAI

client = OpenAI(base_url="https://api.modeless.ai/v1", api_key="<your-modeless-key>")

stream = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Write a migration for..."}],
    stream=True,
    extra_headers={"X-Session-ID": "task-1842"},
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")