Coding agents
Point Claude Code, Codex, Cursor, OpenCode, Hermes, Pi, Cline, VS Code or Conductor at the gateway with one key.
The three values
Every agent needs a base URL, your key and a slug. export the key (a plain KEY=... line is invisible to child processes). Prove the key with two calls before editing any config, then prove the agent with an isolated run that lists its tools and does one real tool call: tool schemas are where provider strictness shows up.
| Agent protocol | Base URL |
|---|---|
| OpenAI-compatible (Codex, Cursor, OpenCode, Cline, ...) | https://api.experientiallabs.ai/v1 |
| Anthropic (Claude Code, Conductor) | https://api.experientiallabs.ai (no /v1) |
/v1/modelsPOST/v1/chat/completionsexport EXPLABS_API_KEY="YOUR_API_KEY"
curl --fail-with-body https://api.experientiallabs.ai/v1/models \
-H "Authorization: Bearer $EXPLABS_API_KEY"
curl --fail-with-body https://api.experientiallabs.ai/v1/chat/completions \
-H "Authorization: Bearer $EXPLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-6-luna", "messages": [{"role": "user", "content": "reply with the single word: ok"}]}'Context budget: use max_input_tokens
A catalog context_window is usually prompt plus maximum output, and providers count the maximum output inside it. Any agent setting for the context or input budget gets max_input_tokens from GET /api/models/{slug}, never context_window. Pinned to the total, a session grows until the provider refuses it (context_length_exceeded), and /compact then fails the same way. For Claude Code with a non-Anthropic model, set CLAUDE_CODE_MAX_CONTEXT_TOKENS to max_input_tokens rounded down to the nearest 50,000.
| Model | context_window | max_input_tokens | Claude Code pin |
|---|---|---|---|
gpt-6-luna | 1,050,000 | 922,000 | 900000 |
gpt-6-astra | 1,050,000 | 922,000 | 900000 |
claude-opus-5 | 1,000,000 | 1,000,000 | not needed |
/api/models/{slug}curl -s https://api.experientiallabs.ai/api/models/gpt-6-luna \
| jq '.model | {context_window, max_input_tokens, max_output_tokens}'Claude Code
Uses /v1/messages. Set ANTHROPIC_API_KEY, never ANTHROPIC_AUTH_TOKEN (a claude.ai sign-in can outrank it and send an OAuth token instead). Start a new session after changing these. Name models by dot-form slug (claude-fable-5.1); <slug>[1m] selects a 1M window where served. Claude Code's own cost figure uses Anthropic's prices; read real cost from usage.
To keep a claude.ai sign-in (Artifacts), leave ANTHROPIC_API_KEY unset, set ANTHROPIC_CUSTOM_HEADERS="x-api-key: YOUR_API_KEY" (Claude Code 2.1.227+), then /login once.
export ANTHROPIC_BASE_URL="https://api.experientiallabs.ai"
export ANTHROPIC_API_KEY="YOUR_API_KEY"
export ANTHROPIC_MODEL="claude-opus-5"
claudeCodex
Codex speaks only the Responses API. Add a provider to ~/.codex/config.toml; leave requires_openai_auth unset (it forces a ChatGPT login). previous_response_id works on any worker for 30 days; an expired id makes Codex resend the conversation.
model = "gpt-5.6-sol"
model_provider = "explabs"
model_reasoning_effort = "max"
[model_providers.explabs]
name = "Experiential Labs"
base_url = "https://api.experientiallabs.ai/v1"
env_key = "EXPLABS_API_KEY"
wire_api = "responses"Cursor
Needs a paid Cursor plan (Free serves only Auto). Cursor Settings, Models, API Keys: put the key in OpenAI API Key (no Bearer), enable Override OpenAI Base URL, add each slug as a custom model. Cursor relays from its own servers; Tab autocomplete stays on Cursor. A 400 naming temperature or top_p means the model pins sampling: pick another slug.
OpenAI API Key: YOUR_API_KEY
Override OpenAI Base URL: https://api.experientiallabs.ai/v1
Custom model: claude-opus-5OpenCode
Check opencode --version. 2.x reads a providers block, 1.x a provider block; both work. Model name is the slug exactly (no prices in it). On 2.x add "compatibility": {"cacheFormat": "anthropic"} to each Claude model so it caches on every lane; 1.x caches Claude automatically.
{
"$schema": "https://opencode.ai/config.json",
"model": "explabs/gpt-6-luna",
"providers": {
"explabs": {
"package": "@opencode/ai/providers/openai-compatible",
"name": "Experiential Labs",
"settings": {
"baseURL": "https://api.experientiallabs.ai/v1",
"apiKey": "{env:EXPLABS_API_KEY}"
},
"models": {
"gpt-6-luna": {"name": "gpt-6-luna", "limit": {"context": 922000, "output": 128000}}
}
}
}
}Hermes, Pi, Cline, VS Code
| Agent | Where | Notes |
|---|---|---|
| Hermes Agent | ~/.hermes/config.yaml, key in ~/.hermes/.env | api_mode: chat_completions; /model custom:explabs:<slug> switches |
| Pi | ~/.pi/agent/models.json | "api": "openai-completions", "apiKey": "$EXPLABS_API_KEY"; contextWindow = max_input_tokens |
| Cline | Settings UI | Provider "OpenAI Compatible"; Context Window Size = max_input_tokens |
| VS Code Copilot (1.122+) | chatLanguageModels.json | vendor: customendpoint; keep "temperature": null, "top_p": null (null deletes them; Copilot otherwise sends values sampling-pinned models reject); enter the key via Manage Models |
providers:
explabs:
base_url: "https://api.experientiallabs.ai/v1"
key_env: "EXPLABS_API_KEY"
api_mode: chat_completions
model:
provider: "custom:explabs"
default: "claude-opus-5"Conductor
Conductor runs Claude Code with your login-shell env. Commit the base URL and picker remaps in the repo's .claude/settings.json (it overrides the captured shell env); keep only the key in a gitignored .conductor/settings.local.toml. Picker selections arrive as --model, so remap them with ANTHROPIC_DEFAULT_*_MODEL (ANTHROPIC_MODEL does not apply). Settings reach new workspaces only.
{"env": {"ANTHROPIC_BASE_URL": "https://api.experientiallabs.ai",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5"}}Any other OpenAI-compatible tool
Tools built on the OpenAI SDKs honor the standard environment pair.
export OPENAI_BASE_URL="https://api.experientiallabs.ai/v1"
export OPENAI_API_KEY="YOUR_API_KEY"Troubleshooting
| You see | Cause and fix |
|---|---|
Claude Code: Not logged in · Please run /login | No usable key (changed mid-session, or a remembered "No" under customApiKeyResponses.rejected in .claude.json). Restart with --resume; never run /login |
403 ... not granted | Not a slug (dated id). Use the dot form from /v1/models |
502 provider stream failed | Provider dropped the stream; let retries run |
| Early auto-compact at 200k | Unknown model name; set CLAUDE_CODE_MAX_CONTEXT_TOKENS |
context_length_exceeded, compaction fails | Pinned to context_window; start fresh and pin max_input_tokens |
Fable missing from /model | Set "model": "claude-fable-5.1" or --model |
400 naming temperature / top_p | The client sends sampling the model pins; remove it or change slug |
Rotate keys safely: mint the new key, verify it with the isolated test, swap it in, start a new session, then revoke the old one. Mint one key per agent to see spend per tool.
claude --resume <session-id>