Lovely RouterDocs
Get a key
Get started

Use with your tools

Point Claude Code, Codex CLI, Gemini CLI, desktop chat apps and the official SDKs at Lovely Router with one API key.

Any tool that lets you change its API base URL works with Lovely Router. You change two settings, the base URL and the key, and keep everything else. You need an API key first.

Set up in one click#

The API keys page has a Use in tools button on every key, and a Use in tools… button next to a key you just created. It opens a dialog with the setup for each client below, filled in with your key, plus one-click import links:

  • Claude Code, Codex CLI, Gemini CLI: Import with CC Switch adds Lovely Router as a provider in the CC Switch desktop app, with the models already set. CC Switch must be installed.
  • Cherry Studio, DeepChat, AionUI: Open in the app adds Lovely Router as a provider. The app must be installed.

Right after you create a key, the dialog already contains it. For an existing key, paste the full key into the dialog: Lovely Router stores only a hash, so it can't show the key again.

Configure your client#

Each guide has the full setup for one client: the commands and config files, which models to pick, and fixes for common errors.

Base URL by API format#

The base URL depends on the API the client speaks, not on the model:

API formatClientsBase URL
Anthropic MessagesClaude Code, Anthropic SDKhttps://lovelyrouter.com
OpenAI Chat Completions and ResponsesCodex CLI, OpenAI SDK, OpenAI-compatible appshttps://lovelyrouter.com/v1
GeminiGemini CLI, Google Gen AI SDKhttps://lovelyrouter.com
OpenAI-compatible "API host"Cherry Studio, DeepChat, AionUIhttps://lovelyrouter.com (the app adds /v1)

Give your agent data tools over MCP#

The MCP server at https://lovelyrouter.com/mcp gives any MCP client the data tools and the browser agent, billed from the same balance. It authenticates with the same key. The Claude Code, Codex CLI and Gemini CLI guides have the one-line command. For other clients and the full list of MCP tools, see MCP server.

Troubleshooting#

SymptomFix
401 with Missing API keyThe tool isn't sending the key. Check the variable name, and that you exported it in the shell that starts the tool.
401 with Invalid or revoked API keyThe key is mistyped, truncated or revoked. Paste it again, or create a new one.
404 with Model '...' is not availableThe model id doesn't exist. Copy an id from GET /v1/models or the model list.
404 with Unknown endpointThe tool is calling an API Lovely Router doesn't serve, such as embeddings or audio. Switch it to Chat Completions, the Responses API, or the Anthropic or Gemini format.
404 on a path containing /v1/v1/The app appends /v1 itself. Use https://lovelyrouter.com as the host.
402Your balance is empty or the key reached its spend limit. See Credits & billing.

Each client guide lists the errors specific to that client. Every other status is covered in Errors.