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.
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.
Create an API key
Sign up at modeless.ai and create a key in the console.
Point Claude Code at Modeless
Add these to your shell profile, then open a new terminal.
bashexport ANTHROPIC_BASE_URL="https://api.modeless.ai" export ANTHROPIC_AUTH_TOKEN="<your-modeless-key>" export ANTHROPIC_MODEL="auto"Check it works
Run
claudeand send one message./statusshows the Modeless base URL.- · Routing survives context compaction: the session keeps its model.
- · Sub-agents get their own routing state, separate from the parent.
Create an API key
Sign up at modeless.ai and create a key in the console.
Add a provider to ~/.codex/config.toml
tomlmodel = "auto" model_provider = "modeless" [model_providers.modeless] name = "Modeless" base_url = "https://api.modeless.ai/v1" env_key = "MODELESS_API_KEY" wire_api = "responses"Export your key
bashexport MODELESS_API_KEY="<your-modeless-key>"Check it works
Run
codexand send one message. The header shows modelauto.
Create an API key
Sign up at modeless.ai and create a key in the console.
Add Modeless to opencode.json
json{ "$schema": "https://opencode.ai/config.json", "provider": { "modeless": { "npm": "@ai-sdk/openai-compatible", "name": "Modeless", "options": { "baseURL": "https://api.modeless.ai/v1", "apiKey": "{env:MODELESS_API_KEY}" }, "models": { "auto": { "name": "Auto" }, "fusion": { "name": "Fusion" } } } }, "model": "modeless/auto" }Check it works
Run
opencode, pickmodeless/autowith /models, and send one message.
Create an API key
Sign up at modeless.ai and create a key in the console.
Open Cline settings
Set API Provider to OpenAI Compatible, then fill in:
textBase URL https://api.modeless.ai/v1 API Key <your-modeless-key> Model ID autoCheck it works
Start a new task. The task header shows model
auto.
Create an API key
Sign up at modeless.ai and create a key in the console.
Settings → Models
Enable Override OpenAI Base URL, paste your key, and add custom models:
textOpenAI Base URL https://api.modeless.ai/v1 OpenAI API Key <your-modeless-key> Custom models auto, fusionCheck it works
Select
autoin the chat model picker and send one message.
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.aiAdd /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.
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="")from anthropic import Anthropic
client = Anthropic(base_url="https://api.modeless.ai", api_key="<your-modeless-key>")
msg = client.messages.create(
model="fusion",
max_tokens=4096,
messages=[{"role": "user", "content": "Review this design: ..."}],
)
print(msg.content[0].text)curl https://api.modeless.ai/v1/responses \
-H "Authorization: Bearer $MODELESS_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Session-ID: task-1842" \
-d '{"model": "auto", "input": "Explain this stack trace: ..."}'