Lovely RouterDocs
Get a key
Integrations

OpenAI-compatible apps

Use any OpenAI-compatible app, agent framework or library with a Lovely Router API key: set the base URL, the key and a model id.

Most apps, agent frameworks and libraries that call OpenAI can call Lovely Router. Lovely Router serves the OpenAI Chat Completions API at https://lovelyrouter.com/v1 for every text model, Claude and Gemini included, so one custom endpoint gives the app all of them. You need an API key first.

Settings#

Find the setting for a custom endpoint and enter:

SettingValue
Base URLhttps://lovelyrouter.com/v1
API keyyour lr-... key
Modelany id from GET /v1/models, such as gpt-6.1-sol or claude-sonnet-5.5

If the app asks for an API host and appends /v1 itself, enter https://lovelyrouter.com without /v1.

Environment variables#

Tools built on the official OpenAI or Anthropic SDKs often read the base URL from the environment:

Shell
# OpenAI SDK based tools
export OPENAI_BASE_URL=https://lovelyrouter.com/v1
export OPENAI_API_KEY=$LOVELY_API_KEY

# Anthropic SDK based tools
export ANTHROPIC_BASE_URL=https://lovelyrouter.com
export ANTHROPIC_API_KEY=$LOVELY_API_KEY

Writing your own code? SDKs has client examples in Python and Node.js, and OpenAI Chat Completions covers streaming, function calling and what is supported.

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 with not served in responses formatThe Responses API serves GPT models only. Pick a gpt-* model, or use Chat Completions for other models.
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.

Every other status is covered in Errors.