Console

Coding Agents

BasicRouter works with coding agents and AI development tools that support OpenAI-compatible or Anthropic-compatible API endpoints. Use routing aliases such as mwf/coding-auto so BasicRouter can route to the best available coding model without requiring developers to change tool configuration.

Generic OpenAI-compatible setup

Use this setup for Cursor, Codex, Hermes, OpenClaw, Continue, Aider, Cline, LangChain-based agents, LlamaIndex-based agents, and custom OpenAI-compatible agent runtimes.

export OPENAI_BASE_URL="https://api.basicrouter.ai/api/v1"
export OPENAI_API_KEY="$BASICROUTER_API_KEY"
export OPENAI_MODEL="mwf/coding-auto"

Generic Anthropic-compatible setup

Use this setup for Claude-compatible clients and tools that expect Anthropic Messages format.

export ANTHROPIC_BASE_URL="https://api.basicrouter.ai/api/anthropic"
export ANTHROPIC_API_KEY="$BASICROUTER_API_KEY"
export ANTHROPIC_MODEL="mwf/coding-auto"
Use caseRecommended aliasRequirements
General codingmwf/coding-autoTool calling, streaming, strong coding ability.
Fast coding chatmwf/coding-fastLow latency and streaming.
Large repo analysismwf/coding-longLong context and stable output.
Cost-sensitive coding assistantmwf/low-costLower price and acceptable coding quality.
UI screenshot / vision codingmwf/vision-chatVision input and text output.

Cursor quick guide

Use the OpenAI-compatible endpoint.

Base URL: https://api.basicrouter.ai/api/v1
API Key:  BASICROUTER_API_KEY
Model:    mwf/coding-auto

Recommended steps:

  1. Open Cursor settings.
  2. Add or enable OpenAI-compatible API key configuration.
  3. Set the OpenAI base URL override to https://api.basicrouter.ai/api/v1.
  4. Add a custom model such as mwf/coding-auto, mwf/coding-fast, or mwf/coding-long.
  5. Use a model that supports streaming and tool calling for best agent behavior.

Troubleshooting:

IssueSuggested fix
Model not shownAdd the model name manually as a custom model.
Tool calling failsUse a model with tool_calling: true in the Models page.
Streaming interruptedRetry with backoff or use a routing alias with fallback.
401 errorCheck the API key and base URL.
404 model errorConfirm the model is enabled for the account.

Claude Code quick guide

Use the Anthropic-compatible gateway endpoint.

export ANTHROPIC_BASE_URL="https://api.basicrouter.ai/api/anthropic"
export ANTHROPIC_API_KEY="$BASICROUTER_API_KEY"
export ANTHROPIC_MODEL="mwf/coding-auto"

BasicRouter supports this Anthropic-compatible path for Claude Code and Anthropic SDK compatibility:

POST /api/v1/messages

Recommended requirements:

RequirementReason
Anthropic Messages-compatible request shapeClaude Code expects Anthropic-style messages.
Streaming supportClaude Code relies on streaming UX.
Tool calling supportRequired for agentic coding workflows.
Long contextUseful for repository-level tasks.
Stable fallbackUseful for long-running coding sessions.

Codex quick guide

Use BasicRouter as a custom OpenAI-compatible model provider.

Example provider configuration:

[model_providers.basicrouter]
name = "BasicRouter"
base_url = "https://api.basicrouter.ai/api/v1"
env_key = "BASICROUTER_API_KEY"
wire_api = "responses"

model_provider = "basicrouter"
model = "mwf/coding-auto"

Environment variable:

export BASICROUTER_API_KEY="br_xxx"

Recommended models:

ModelUse case
mwf/coding-autoDefault coding agent model.
mwf/coding-longLarge repository context.
mwf/coding-fastFast iteration and small changes.

Troubleshooting:

IssueSuggested fix
Auth errorConfirm env_key points to BASICROUTER_API_KEY.
Model not foundAdd the alias in BasicRouter Console or use a direct model ID.
Responses API errorUse wire_api = "responses" only for models and endpoints that support Responses.
Chat Completions-only modelSwitch to a chat-compatible wire API if the client supports it.

Hermes quick guide

Use the OpenAI-compatible endpoint unless your Hermes deployment is configured for another protocol.

export OPENAI_BASE_URL="https://api.basicrouter.ai/api/v1"
export OPENAI_API_KEY="$BASICROUTER_API_KEY"
export OPENAI_MODEL="mwf/coding-auto"

Recommended model policy:

Hermes workloadModel
General code generationmwf/coding-auto
Low-latency task executionmwf/coding-fast
Long-context repo scanmwf/coding-long
Cost-sensitive background tasksmwf/low-cost

OpenClaw quick guide

Use the OpenAI-compatible endpoint for OpenAI-style agent runtime configuration.

export OPENAI_BASE_URL="https://api.basicrouter.ai/api/v1"
export OPENAI_API_KEY="$BASICROUTER_API_KEY"
export OPENAI_MODEL="mwf/coding-auto"

If OpenClaw supports multiple providers, configure BasicRouter as an OpenAI-compatible provider and use BasicRouter routing aliases for model selection.

{
  "provider": "openai-compatible",
  "base_url": "https://api.basicrouter.ai/api/v1",
  "api_key_env": "BASICROUTER_API_KEY",
  "model": "mwf/coding-auto"
}

Agent compatibility checklist

CapabilityRequired for
StreamingGood terminal/editor UX.
Tool callingAgentic coding, file edits, command execution.
Long contextLarge repositories and multi-file changes.
Structured outputsPlanning, task decomposition, automated workflows.
Vision inputUI screenshot analysis and design-to-code workflows.
FallbackProduction stability and long-running tasks.