Skip to content

Generic OpenAI-compatible clients

The pattern that works for any tool that lets you set a base URL and an API key.

updated
on this page
  1. Settings to set
  2. What does not work
  3. Parameters and balance
  4. Confirming it works
  5. Tools we know work without changes
  6. When to prefer the OpenAI path over a tool’s native provider

If a tool isn’t on this list, it almost certainly works as long as it exposes two settings: base URL and API key. Fill them in as below.

Settings to set

Setting Value
Provider type OpenAI Compatible (sometimes “Custom OpenAI” or “OpenAI API”)
Base URL https://api.lowrouter.ai/v1
API Key your sk-lr-... token
Path / endpoint /chat/completions (most tools handle this automatically), or /responses for tools that use the Responses API
Model any LowRouter model ID, e.g. auto/mistralai/mistral-large-3-675b-instruct-2512, openai/openai/gpt-4.1, …

What does not work

  • Tools that hard-code https://api.openai.com without a base-URL setting cannot be redirected. Some have a OPENAI_API_BASE environment variable that achieves the same thing.
  • Tools that require a specific model ID format (e.g. gpt-4 with no provider prefix) need the model picker reconfigured to accept arbitrary strings. Most have a “custom model name” field.
  • Tools that send Anthropic-shaped requests on the OpenAI endpoint will be rejected. That endpoint takes OpenAI-shaped chat-completions requests only.

Parameters and balance

Every chat-completions parameter is either applied, refused with a 400 that names it, or listed in the response’s lowrouter_unapplied. None is dropped silently, so a client asking for response_format JSON never gets prose back without being told. See request parameters. Clients that display an OpenRouter-style balance can read GET /v1/key and GET /v1/credits.

Confirming it works

Before integrating, test from the command line that the tool’s settings are right:

Bash
curl https://api.lowrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"auto/mistralai/mistral-large-3-675b-instruct-2512","messages":[{"role":"user","content":"hi"}]}'

If curl returns a completion, the tool will too once it’s configured with the same URL and key.

Tools we know work without changes

  • LangChain (OpenAI and ChatOpenAI classes; set openai_api_base and openai_api_key).
  • LlamaIndex (OpenAI and OpenAILike LLMs).
  • LiteLLM (proxy and library; set api_base and api_key).
  • Vercel AI SDK (createOpenAI from @ai-sdk/openai-compatible).
  • LM Studio (Server tab → custom backend).

When to prefer the OpenAI path over a tool’s native provider

If a tool has both an “OpenAI” and an “LowRouter / OpenRouter / custom gateway” option, prefer the OpenAI Compatible one. It has the fewest surprises: the tool sends a standard chat-completions request, LowRouter resolves the route, and the response is in the shape the tool already expects.