Providers
A provider is one upstream endpoint plus its credentials. Providers are independent of the model names clients see, so you can add several providers serving the same model and let fallback and priority decide who answers.

Adding a provider
Providers → Add Provider. Fields:
| Field | Notes |
|---|---|
| Name | Unique identifier referenced by model mappings (for example openai-prod) |
| Type | One of the built-in provider types (table below) |
| API key | Required for most types; not required for ollama, vllm, or sglang |
| Base URL | Pre-filled per type. Required for openai-compatible. Trailing slashes are trimmed |
| Icon URL | Optional logo shown next to the provider in the console. Must be a public http: or https: URL; private and loopback addresses are rejected |
| Gemini Interactions | gemini type only: use Google's Interactions API instead of generateContent. The provider list shows an Interactions badge |
| Gemini model family overrides | gemini type only (set via API metadata.model_family_overrides): maps an exact model ID to a Gemini family version (for example {"gemini-flash-latest": "4.0"}) for generateContent. Use this when a model ID has no gemini-X.Y segment (Google aliases or aggregator nicknames). Without it, the proxy emits thinkingLevel for thinking and falls back to legacy-safe shapes for schemas, signatures, and sampling parameters. Values must be versions such as "4.0" or "3.8". No-op on the Interactions API |
| Custom headers | Extra headers sent upstream (for example tenant or organization headers). These override any other source for the same header name |
| App Attribution | openrouter type only: application URL (HTTP-Referer), name, marketplace categories, and ranking visibility. Unset values credit the LLM Proxy project |
| Endpoint base URLs | Per-endpoint overrides; the URL is used as-is without appending the endpoint path |
| Native web search | Enable when the upstream provides its own web-search tool so the proxy passes web_search tools through instead of intercepting them |
Provider API keys are masked in the console; the edit dialog shows only a masked, disabled field. To read a key back, call the audited POST /api/config/providers/{name}/api-key/reveal endpoint. Keys are encrypted at rest using ENCRYPTION_KEY; rotating that environment variable makes stored keys undecryptable.
Provider types
| Type | Upstream wire protocol | Default base URL |
|---|---|---|
openai | Chat Completions + Responses | https://api.openai.com/v1 |
openai-chatgpt | OpenAI Responses (OAuth, ChatGPT plan) | https://api.openai.com/v1 |
anthropic | Anthropic Messages (x-api-key, anthropic-version: 2023-06-01) | https://api.anthropic.com |
openai-compatible | Chat Completions (generic; base URL required) | — |
gemini | Google generateContent (x-goog-api-key) | https://generativelanguage.googleapis.com/v1beta |
ollama | Native Ollama (/api/chat, /api/tags) + OpenAI-compatible speech (/v1/audio/speech) | http://localhost:11434 |
vllm | Chat Completions | http://localhost:8000/v1 |
sglang | Chat Completions | http://localhost:30000/v1 |
deepseek | Chat Completions + native Anthropic/Responses | https://api.deepseek.com/v1 |
xai | Chat Completions + native Responses | https://api.x.ai/v1 |
zai | Chat Completions (GLM layout) | https://api.z.ai/api/paas/v4 |
zai-coding | Chat Completions + native Anthropic/Responses | https://api.z.ai/api/coding/paas/v4 |
zhipu | Chat Completions + native Anthropic | https://open.bigmodel.cn/api/paas/v4 |
zhipu-coding | Chat Completions + native Anthropic/Responses | https://open.bigmodel.cn/api/coding/paas/v4 |
moonshot | Chat Completions + native Anthropic | https://api.moonshot.ai/v1 |
kimi-code | Chat Completions + native Anthropic | https://api.kimi.com/coding/v1 |
minimax | Chat Completions + native Anthropic/Responses | https://api.minimax.io/v1 |
qwen | Chat Completions + native Anthropic/Responses | https://dashscope.aliyuncs.com/compatible-mode/v1 |
qwen-intl | Same as qwen (international keys are region-bound) | https://dashscope-intl.aliyuncs.com/compatible-mode/v1 |
openrouter | Chat Completions + native Responses | https://openrouter.ai/api/v1 |
chutes | Chat Completions | https://llm.chutes.ai/v1 |
mistral | Chat Completions | https://api.mistral.ai/v1 |
cohere | Native Cohere v2 (/v2/chat, /v2/embed, /v2/rerank, /v2/audio/transcriptions) | https://api.cohere.com |
nanogpt | Chat Completions | https://nano-gpt.com/api/v1 |
opencode-zen | Per-model dialect: Chat Completions / Anthropic / Responses / Google / System One (see below) | https://opencode.ai/inference |
opencode-go | Same gateway, subscription lane (own model catalog) | https://opencode.ai/inference/go |
Native protocol means the proxy forwards a request verbatim to that upstream when the client speaks the same protocol (Anthropic clients hitting a native-Anthropic provider, Responses clients hitting a native-Responses provider), preserving fields the translation layer would otherwise normalize. vllm and sglang opt in per provider via provider metadata native_passthrough: true.
Cost reporting: openrouter and nanogpt return their own cost figures, which the proxy records instead of computing them from token prices.
OpenAI (ChatGPT OAuth) (openai-chatgpt)
Use openai-chatgpt to authenticate via OpenAI's Sign in with ChatGPT OAuth 2.0 / OIDC flow (chatgpt.tokens.use.direct) and consume an eligible ChatGPT subscription (Plus, Pro, or Business) instead of a platform API key.
- Dynamic client registration: by default, the first sign-in runs OpenAI's dynamic registration flow and stores the issued
client_idper provider for future refreshes and re-authorizations. You can optionally supply a staticclient_id(andclient_secret) under OAuth options. - Localhost vs remote callback: when accessing the console from
localhostor127.0.0.1, the popup completes sign-in automatically. On remote servers, use a loopback redirect URI such ashttp://127.0.0.1:1455/auth/callbackand paste the final redirected URL into the Callback URL field in the provider dialog. - Direct plan-usage requirements: upstream requests target
POST /v1/responseswithstream: trueandstore: false. Non-streaming client requests aggregate the upstream stream back into a JSON response. - Token lifecycle: access tokens (~1 hour) and rotated refresh tokens (~30 days) are encrypted at rest and refreshed automatically before expiry or on a
401response. - Model listing: fetching models queries
GET /v1/modelswith the OAuth access token and returns the models visible to the signed-in account.
OpenCode (opencode-zen / opencode-go)
Use the dedicated opencode-zen or opencode-go provider types for this gateway. A generic openai-compatible provider pointed at opencode.ai does not send the gateway's identity and session headers.
The OpenCode gateway fronts model families whose upstreams speak different wire protocols. The dialect is resolved per model from learned corrections, the models.dev catalog (cached for 6 hours), and then model-ID prefix heuristics (Chat Completions by default). Claude models use Anthropic Messages, GPT/Grok use OpenAI Responses, Gemini uses generateContent, Jev uses System One (/v1/systemone only; chat requests for Jev models are rejected), and everything else uses Chat Completions.
- Lanes:
opencode-zenis the Console pay-as-you-go lane (https://opencode.ai/inference), andopencode-gois the subscription lane (https://opencode.ai/inference/go). The two lanes serve different model catalogs. Each lane root hangs each dialect off its own path segment (/openai/v1,/anthropic/v1,/google/v1beta,/systemone/v1, with models at<root>/v1/models). Legacy flat roots (https://opencode.ai/zen/v1,https://opencode.ai/zen/go/v1) and the older Console root (https://opencode.ai/inference/v1) remain selectable via Base URL. - Headers:
Authorization: Beareris sent everywhere, plus the dialect's auth header where required (x-api-keyfor Anthropic,x-goog-api-keyfor Google). Identity headers (x-opencode-client,x-opencode-project, conversation-scopedx-opencode-session, and per-requestx-opencode-request) are sent by default. The Zen lane keepsUser-Agent: opencode/...for free-tier eligibility; the Go lane sendsUser-Agent: llm-proxy/<version>. Any of these can be overridden via Custom headers, including with an empty value. - Session affinity:
x-opencode-sessionidentifies a conversation so OpenCode can pin it to one backend and reuse its prompt cache. The proxy derives it from the client's session header (x-opencode-session,x-claude-code-session-id, Codexsession_id/thread-id,x-session-affinity,x-deepseek-harness-session-id,agent-session-id, orx-amp-thread-id), then body-levelsession_id/conversation_id/thread_id, then Anthropicmetadata.user_idorprompt_cache_key, then a deterministic fingerprint of the first user message (with Copilot-style<environment_info>/<context>blocks stripped). Setx-opencode-sessionin Custom headers to pin a fixed ID and disable per-conversation affinity. - Self-healing: if the gateway rejects a model with a model-related 400 or 404, the proxy retries on the remaining dialects (Chat Completions first) and remembers the working dialect for the process lifetime.
- Model list:
/v1/modelsreturns bare IDs; display names, context windows, and pricing come from the models.dev catalog. Set provider metadataopencode_catalog_urlto a mirror URL to pin the catalog, or to an empty value to disable it.
OpenRouter specifics
OpenRouter routes across multiple upstreams, so the proxy preserves its request shapes:
- Responses and Messages passthrough:
/v1/responsesand/v1/messagesclients are forwarded verbatim, keepingreasoning.mode,reasoning.context,thinkingbudgets,context_management,providerrouting preferences,plugins,modelsfallbacks, andusageaccounting intact. Set provider metadatanative_passthrough: falseto fall back to Chat Completions translation. - Unified
reasoningobject: the proxy sendsreasoning: {effort, mode, context, summary, max_tokens, exclude, enabled}instead of a barereasoning_effortso Responses-only fields such asmode: "pro"survive. OpenRouter honorsmode: "pro"only when routing to OpenAI or Azure on GPT-5.6 and newer. - App attribution: App Attribution in the provider dialog sets
HTTP-Referer,X-OpenRouter-Title, marketplace categories (at most two), and public listing. Unset fields credit LLM Proxy; Custom Headers override both. Values must be printable ASCII and the URL must be an absolutehttp(s)URL. - Forwarded client headers:
X-OpenRouter-Metadata,X-OpenRouter-Cache,X-OpenRouter-Cache-TTL,X-OpenRouter-Cache-Clear,x-session-id, andx-anthropic-beta(needed for Claude beta opt-ins such asstructured-outputs-2025-11-13) are forwarded. Client Codex and Claude Code fingerprint headers are stripped. - Per-endpoint passthrough fields: chat preserves
provider,models,plugins,session_id,trace,preset,structured_outputs,cache_control,min_p,top_k,top_a,repetition_penalty, plus legacyroute,transforms,usage, andinclude_reasoning. Embeddings preserveinput_type,session_id,trace,provider, anduser. Images preserveresolution,aspect_ratio,seed,input_references, andprovider(normalized tooutput_format,background,output_compression). TTS preservesinput_referencesandprovider; STT preservesprovider. - Response metadata:
X-Generation-IdandX-OpenRouter-Cache-*headers are forwarded to the client;cost,cost_details, andis_byokfromusagefeed the cost record. - Model picker: the catalog is fetched with
output_modalities=allso image, video, audio, and embedding models appear alongside text models with their context length, modalities, supported parameters, and pricing. - Audio: speech (
mp3/pcm) and transcription (json/verbose_json) formats are validated locally./v1/audio/translationsis rejected locally because OpenRouter has no audio translation endpoint. - Model variants:
:free,:nitro,:floor,:online,:thinking, and*-provariants pass through as plain model strings. Because model lookup is an exact match, register each variant as its own model or route to it with an alias.
Qwen (Model Studio / DashScope) specifics
Two provider types cover the region-bound DashScope domains: qwen (Beijing, dashscope.aliyuncs.com) and qwen-intl (Singapore, dashscope-intl.aliyuncs.com). API keys are region-bound, so an international key only works with qwen-intl and vice versa. Business-space dedicated domains (https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/…) work through Base URL.
- Native protocols: Anthropic Messages (
{host}/apps/anthropic/v1/messages) and OpenAI Responses ({base_url}/responses) are forwarded verbatim. The Anthropic endpoint exposes only/v1/messages, so/v1/modelsreturns 404. - Chat vendor fields: unrecognized chat fields pass through to DashScope, so
enable_thinking,thinking_budget,enable_search,search_options,tool_stream, andenable_code_interpreterwork viaextra_body. - Images: Wan and Qwen-Image run through the DashScope async task API. Extension fields (
image,negative_prompt,seed,prompt_extend,prompt_extend_mode,enable_thinking,watermark, and on editsbbox_list,color_palette,enable_sequential,thinking_mode) are forwarded flat on the body. DashScope has no mask concept; passbbox_listinstead. - Embeddings:
text-embedding-v1..v4andqwen3.7-text-embeddinguse{base_url}/embeddings.dimensionsand per-request row caps (20 forqwen3.7-text-embedding, 10 for v3/v4, 25 for v1/v2) are validated at the proxy. - No audio:
/v1/audio/*against aqwenprovider returns400. Speech synthesis uses DashScope's native multimodal endpoint, and ASR (qwen3-asr-flash) uses/chat/completionswithinput_audiocontent parts. - Web search: set
native_web_search: trueto passweb_searchtools to DashScope's Responses API (web_search,web_extractor,code_interpreter). On Chat Completions the proxy emitsenable_search: truewith DashScope's defaultsearch_options. On the Anthropic-compatible endpoint, DashScope runsweb_search_20250305only when the request includes its billing header in asystemblock (x-anthropic-billing-header: cc_entrypoint=cli;).
DeepSeek specifics
DeepSeek serves three wire protocols from one host: Chat Completions (https://api.deepseek.com/v1), Anthropic Messages (https://api.deepseek.com/anthropic/v1/messages), and OpenAI Responses (https://api.deepseek.com/responses).
- Native web search: DeepSeek runs
web_searchserver-side on the Responses endpoint only, and only fordeepseek-v4-pro(deepseek-flashignores it). Declare{"type": "web_search"}or{"type": "web_search_2025_08_26"}and enable Native web search (native_web_search: true). Chat Completions has no server-side web search; use proxy-side search there. - Anthropic endpoint:
server_tool_useandweb_search_tool_resultblocks survive replay, but DeepSeek's built-in tool list only includesfunction, soweb_search_20250305is not executed there. - Stateless Responses: DeepSeek has no
previous_response_id. The proxy materializes stored turns intoinputitems and falls back to Chat Completions translation for that turn, so materialized continuations cannot use server-sideweb_search.
MiniMax specifics
MiniMax serves Chat Completions (https://api.minimax.io/v1/chat/completions), Anthropic Messages (https://api.minimax.io/anthropic/v1/messages), and OpenAI Responses (https://api.minimax.io/v1/responses). The two native endpoints are forwarded verbatim.
- Thinking parameters: on native Messages and Responses passthrough,
thinking,output_config,reasoning_effort, andreasoningpass through untouched (MiniMax-M3.1-Flashrejects disabled thinking directly upstream). On Chat Completions, translated thinking fields andreasoning_splitare forwarded as-is. reasoning_split: with it off, thinking content stays insidecontentwrapped in<think>tags instead of moving toreasoning_content.- Video input: M-series models accept image and video (
video_urlon Chat Completions,videoblocks on Messages). - Service tier: MiniMax uses
standardandpriority(1.5× cost; unsupported onMiniMax-M3.1-Flash). Client valuesstandard_onlyanddefaultmap tostandard,prioritystayspriority, and unsupported values (auto,flex) are dropped. - In-body errors: Chat Completions returns HTTP 200 with failures in
base_resp.status_code(1002 rate limit, 1004 auth, 1008 balance, 1026/1027 sensitive content, 2013 invalid params). The proxy converts these to standard HTTP status codes (429/401/402/400). - Token counting:
POST /v1/messages/count_tokensandPOST /v1/responses/input_tokensare forwarded to MiniMax's own counters rather than estimated locally.
Cohere specifics
The cohere type uses Cohere's native v2 API (https://api.cohere.com): POST /v2/chat, /v2/embed, /v2/rerank, and /v2/audio/transcriptions. Every request is translated because Cohere has no Anthropic Messages or OpenAI Responses endpoint.
- Chat messages: all system and developer turns are folded into the single leading system message. Tool outputs become
role: "tool"messages keyed bytool_call_id. - Sampling:
top_pmaps top,stopmaps tostop_sequences(at most 5), andtemperature,max_tokens,frequency_penalty,presence_penalty, andseedmap one-to-one.n > 1is rejected to avoid multiplying billed requests. - Structured output:
response_formatwithjson_schemamaps to{"type": "json_object", "json_schema": <schema>}(no strict flag). v2 cannot combineresponse_formatwithdocumentsortools. - Thinking: maps to
{"type": "enabled"|"disabled", "token_budget": N}. Reasoning is on by default for supported models;disabledornonesends the off spelling, andtoken_budgetis only set when explicitly provided. - Tools: function tools require
parameters(defaulting to{}).tool_choicemaps toREQUIREDorNONE(named choices becomeREQUIRED;autoomits the field). Hosted tools are dropped with a warning. - Cohere-only fields:
documents,citation_options,safety_mode,strict_tools,priority,k, andlogprobspass throughextra. RAG citations attach to the text block they cite. - Embeddings: v2 requires
input_type(search_documentby default; passextra.input_typeforsearch_query,classification,clustering, orimage).dimensionsmaps tooutput_dimensionandencoding_format: "base64"maps toembedding_types: ["base64"]. Batches over 96 inputs are rejected. - Rerank: v2 returns indexes and scores without echoing documents, so the proxy re-attaches the request's documents unless the client asked for indexes and scores only. Image-only documents are rejected.
max_tokens_per_doc,relevant_spans, andprioritypass throughextra. - Audio:
/v2/audio/transcriptionsrequireslanguage(ISO-639-1).prompt,response_format, timestamp granularities, andincludeare dropped upstream, and the proxy formats the response as requested. Streaming transcription, TTS, and audio translation are unsupported. - Model list: uses
GET /v1/models.
Gemini specifics
The gemini type uses generateContent, or the Interactions API when Gemini Interactions is enabled. Request shapes depend on the model version (see the family-override row above).
- Dropped parameters:
n > 1andlogprobs/top_logprobsare omitted (and logged) because current Gemini models reject them with 400. - Structured output:
response_format: {"type": "json_schema", …}maps togenerationConfig.responseFormat.textwith full JSON Schema on Gemini 3+, and to sanitizedresponseMimeType+responseSchemaon earlier versions. - Gemini-native fields: inject
generationConfig,cachedContent,safetySettings, and similar fields through a model mapping'sparameter_overrides. An injectedgenerationConfigreplaces the one the proxy builds, so include every field the request needs. - Batch mode:
models/{model}:batchGenerateContentis proxied through the OpenAI-compatible batch surface (see Batch mode). Requests are sent inline (20 MB Gemini limit), and batch mode is refused when Interactions API is enabled. For the same 50% discount on live requests, useservice_tier: "flex".
Web search: native or proxy-side
Two systems can answer a web_search tool, and one runs per request:
- Proxy-side (default): with a search provider configured under Settings → General → Web search (SearXNG or Ollama), the proxy rewrites the hosted tool into a function tool, executes the searches itself, and injects the results. This works for every provider, including Chat-Completions-only upstreams.
- Native (per provider): enable Use Native Web Search on the provider to let the upstream execute the tool. The proxy forwards the tool declaration in that upstream's format (
enable_searchon Qwen,web_searchbody object on NanoGPT,web_search.search_engineon Z.ai) and relays the results.
If both are configured, the provider's Use Native Web Search flag decides.
When an upstream has no documented server-side search on its protocol, the proxy drops the tool and logs a warning rather than returning an unexpected function call to the client. For a custom openai-compatible endpoint with no known dialect, the proxy keeps the function-tool fallback on Chat Completions and forwards verbatim on Responses.
Which upstreams actually search
| Provider | Native server-side search | Reaches the upstream through |
|---|---|---|
openai | Responses web_search; Chat web_search_options (search models) | any client protocol (translated) |
anthropic | web_search_20260318 / 20260209 / 20250305 server tool | Messages (verbatim), Chat web_search_options, or any client declaring web_search |
gemini | google_search grounding (url_context / google_maps are separate tools) | any client protocol |
deepseek | Responses web_search (only deepseek-v4-pro; see above) | Responses (verbatim) |
xai | Responses web_search (filters.allowed_domains / filters.excluded_domains) and x_search | Responses (verbatim) |
qwen, qwen-intl | Responses web_search / web_extractor; Chat enable_search + search_options; Anthropic server tool | Responses and Anthropic (verbatim), Chat if the client sends enable_search |
openrouter | server tool openrouter:web_search (parameters.*); Responses hoists plain web_search into it | Responses and Messages (verbatim), Chat if the client sends the server-tool type or legacy plugins: [{"id": "web"}] |
zai, zai-coding | Chat {"type": "web_search", "web_search": {"search_engine": ...}} (search_pro_jina) | Chat Completions (verbatim) |
zhipu, zhipu-coding | same Chat shape (search_std / search_pro / search_pro_sogou / search_pro_quark); Responses {"type": "web_search"} | Chat (verbatim) |
minimax | Responses {"type": "web_search"}; Anthropic {"type": "web_search_20250305", "name": "web_search"} | Responses and Messages (verbatim); Chat has no server tools |
nanogpt | Responses web_search; Chat body web_search: {"enabled": true, ...} | Responses (verbatim), Chat body field |
moonshot | Responses {"type": "web_search"}; Chat $web_search (type: "builtin_function", deprecated — retires 2026-10-20) | Chat ($web_search, legacy); Messages accepts only client tools |
mistral | none on Chat Completions | proxy-side only |
vllm, sglang, ollama, chutes, cohere, opencode-zen, opencode-go | none | proxy-side only |
The proxy normalizes Anthropic's web_search_20250305 family, OpenAI's web_search / web_search_preview, dated variants (web_search_2025_08_26), and Chat Completions web_search_options into the selected provider's format. A declared web_search function tool always takes precedence over web_search_options.
Provider-specific hosted tools pass through to the protocol that supports them and are dropped with a warning everywhere else:
Hosted tools
| Declaration | Forwarded to | Dropped (with warning) everywhere else |
|---|---|---|
google_search / google_search_retrieval | Gemini ({"google_search": {}}) | yes |
url_context, google_maps | Gemini (bare tool keys) | yes |
code_execution (Anthropic) / code_interpreter (OpenAI) | Gemini ({"code_execution": {}}); native Responses wires | yes |
computer_use, file_search (Gemini) | Gemini (computer_use defaults to ENVIRONMENT_BROWSER; file_search requires fileSearchStoreNames) | yes |
x_search (+ allowed_x_handles, date range, image/video flags) | xAI Responses (verbatim) | yes |
web_extractor | Qwen Responses (verbatim; requires web_search alongside) | yes |
retrieval (knowledge_id) | Z.ai / BigModel Chat Completions | yes |
$web_search (type: "builtin_function") | Kimi Chat Completions (deprecated upstream, retires 2026-10-20) | yes |
file_search (OpenAI, vector_store_ids) | native Responses wires that support it | yes |
| unknown tool types | Responses or Gemini wires, verbatim | dropped on chat wires |
On Gemini 3+ models, mixing a built-in tool with function declarations automatically enables toolConfig.includeServerSideToolInvocations so built-in tool calls and results are shared with the conversation.
Verifying a provider
- Click the refresh button (↻) in the provider-model picker inside the model editor (or call
GET /api/config/providers/{name}/models) to fetch the upstream model list and verify connectivity.ollama,vllm, andsglangneed no API key for this; other types do. - Once a model mapping exists, send a test request from the Chat playground or with
curl, then confirm the row in Logs.
Known limitations
- Upstream calls use a fixed 600 s read timeout (10 s connect). Rate limiting is global or per-key, not per provider.
- Fallback order is set on each model → provider mapping, not on the provider itself (see Models & Pricing).
- To take a provider out of rotation, remove its model mappings or raise another provider's mapping priority.
- Gemini has no Vertex, region, or project fields. Upstreams that require client fingerprint headers work via native passthrough only.
- There are no per-provider health checks; the circuit breaker is the only automatic protection.
Related
- Models & Pricing: map client-facing names onto this provider
- Server Settings: retries, fallback, circuit breaker