API documentation
Copy-ready configuration for both protocols. Replace YOUR_API_KEY with a key from the API Keys page.
OpenAI-compatible
Base URL: https://www.nexusbot.in/v1 · Model: xyz-free-coder
from openai import OpenAI
client = OpenAI(base_url="https://www.nexusbot.in/v1", api_key="YOUR_API_KEY")
resp = client.chat.completions.create(
model="claude-fable-5-2",
messages=[{"role": "user", "content": "hello"}],
)
print(resp.choices[0].message.content)
Endpoints: POST /v1/chat/completions (streaming via SSE supported), GET /v1/models.
Anthropic-compatible (Claude Code)
The gateway implements the real Anthropic Messages protocol — it does not forward your request to an OpenAI endpoint.
export ANTHROPIC_BASE_URL="https://www.nexusbot.in" export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY" export ANTHROPIC_MODEL="claude-opus-5-5" # defaults used by current Claude Code versions when a model is not pinned: export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-opus-5-5" export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-5-5" export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5-5" claude
Endpoints: POST /v1/messages (Anthropic streaming events supported), GET /v1/models. Auth: x-api-key header or Authorization: Bearer.
curl https://www.nexusbot.in/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model": "xyz-free-coder", "max_tokens": 256,
"messages": [{"role": "user", "content": "hello"}]}'
OpenCode
Point OpenCode at the gateway as an OpenAI-compatible provider:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"xyz": {
"npm": "@ai-sdk/openai-compatible",
"name": "XYZ AI Router",
"options": { "baseURL": "https://www.nexusbot.in/v1", "apiKey": "YOUR_API_KEY" },
"models": { "claude-fable-5-2": { "name": "Claude Fable 5.2" } }
}
},
"model": "xyz/claude-fable-5-2"
}
Honesty notes
- Aliases map to real upstream models — the mapping is public on the Models page.
- Tool calling works only where the upstream supports it; unsupported capabilities return errors instead of fake success.
- Agent-backed models (OpenCode) run full agent sessions: the reply may include tool activity, and every run is logged.
- Rate limits and quotas are enforced per key; revoked keys stop working immediately.