Overview

ModRouter exposes several API shapes. Pick the one your client already speaks: Set the gateway root URL from your environment and append the route each client needs:
MODROUTER_BASE_URL should be the reachable ModRouter host with no route suffix. The default ModRouter SaaS root is https://api.modrouter.online; for self-hosted, local, Docker, or reverse-proxy deployments, set the same variable to the root URL reachable from that client. For JSON, TOML, and YAML client configs, the docs show the expanded default URL. If your deployment uses a different root, keep the same route suffix and replace only the root value from your environment or config-management system. For local development or Docker clients, set MODROUTER_BASE_URL to the address reachable from that client.
If CORS or header filtering blocks a client, allow the headers that client sends. ModRouter commonly receives Authorization, X-Api-Key, x-bf-vk, x-bf-mcp-session-id, and provider SDK headers such as anthropic-version.

Model Names

Use ModRouter model IDs in provider/model form when you want to route across providers:
Some provider-native clients accept unprefixed native model names. Prefer prefixed names in docs and shared configs because they make routing explicit.

CLI Agents

LibreChat

Use ModRouter as an OpenAI-compatible chat provider.

Open WebUI

Add ModRouter as an OpenAI-compatible connection.

Claude Code

Route Claude Code through ModRouter’s Anthropic-compatible endpoint.

Claude for Office

Point the Anthropic-compatible Office add-in at ModRouter.

Claude Desktop

Route the Code tab through ModRouter and attach MCP tools to the Chat tab.

Codex CLI

Use ModRouter’s OpenAI-compatible endpoint with Codex CLI.

Gemini CLI

Use ModRouter’s GenAI-compatible endpoint.

Qwen Code

Add ModRouter as an OpenAI-compatible provider.

Opencode

Configure OpenAI or Anthropic provider entries backed by ModRouter.

Editors

Cursor

Use ModRouter’s Cursor compatibility endpoint.

Zed Editor

Add ModRouter as an OpenAI-compatible model provider.

Roo Code

Configure ModRouter as an OpenAI-compatible API provider.

MCP Gateway

ModRouter can expose every configured MCP server behind one endpoint:
You can also send x-bf-vk, X-Api-Key, or x-bf-mcp-session-id depending on your governance and MCP identity mode. See MCP Gateway for tool filtering and auth details.