Skip to content

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.

Providers screen

Adding a provider ​

Providers → Add Provider. Fields:

FieldNotes
NameUnique identifier referenced by model mappings (for example openai-prod)
TypeOne of the built-in provider types (table below)
API keyRequired for most types; not required for ollama, vllm, or sglang
Base URLPre-filled per type. Required for openai-compatible. Trailing slashes are trimmed
Icon URLOptional logo shown next to the provider in the console. Must be a public http: or https: URL; private and loopback addresses are rejected
Gemini Interactionsgemini type only: use Google's Interactions API instead of generateContent. The provider list shows an Interactions badge
Gemini model family overridesgemini 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 headersExtra headers sent upstream (for example tenant or organization headers). These override any other source for the same header name
App Attributionopenrouter type only: application URL (HTTP-Referer), name, marketplace categories, and ranking visibility. Unset values credit the LLM Proxy project
Endpoint base URLsPer-endpoint overrides; the URL is used as-is without appending the endpoint path
Native web searchEnable 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 ​

TypeUpstream wire protocolDefault base URL
openaiChat Completions + Responseshttps://api.openai.com/v1
openai-chatgptOpenAI Responses (OAuth, ChatGPT plan)https://api.openai.com/v1
anthropicAnthropic Messages (x-api-key, anthropic-version: 2023-06-01)https://api.anthropic.com
openai-compatibleChat Completions (generic; base URL required)—
geminiGoogle generateContent (x-goog-api-key)https://generativelanguage.googleapis.com/v1beta
ollamaNative Ollama (/api/chat, /api/tags) + OpenAI-compatible speech (/v1/audio/speech)http://localhost:11434
vllmChat Completionshttp://localhost:8000/v1
sglangChat Completionshttp://localhost:30000/v1
deepseekChat Completions + native Anthropic/Responseshttps://api.deepseek.com/v1
xaiChat Completions + native Responseshttps://api.x.ai/v1
zaiChat Completions (GLM layout)https://api.z.ai/api/paas/v4
zai-codingChat Completions + native Anthropic/Responseshttps://api.z.ai/api/coding/paas/v4
zhipuChat Completions + native Anthropichttps://open.bigmodel.cn/api/paas/v4
zhipu-codingChat Completions + native Anthropic/Responseshttps://open.bigmodel.cn/api/coding/paas/v4
moonshotChat Completions + native Anthropichttps://api.moonshot.ai/v1
kimi-codeChat Completions + native Anthropichttps://api.kimi.com/coding/v1
minimaxChat Completions + native Anthropic/Responseshttps://api.minimax.io/v1
qwenChat Completions + native Anthropic/Responseshttps://dashscope.aliyuncs.com/compatible-mode/v1
qwen-intlSame as qwen (international keys are region-bound)https://dashscope-intl.aliyuncs.com/compatible-mode/v1
openrouterChat Completions + native Responseshttps://openrouter.ai/api/v1
chutesChat Completionshttps://llm.chutes.ai/v1
mistralChat Completionshttps://api.mistral.ai/v1
cohereNative Cohere v2 (/v2/chat, /v2/embed, /v2/rerank, /v2/audio/transcriptions)https://api.cohere.com
nanogptChat Completionshttps://nano-gpt.com/api/v1
opencode-zenPer-model dialect: Chat Completions / Anthropic / Responses / Google / System One (see below)https://opencode.ai/inference
opencode-goSame 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_id per provider for future refreshes and re-authorizations. You can optionally supply a static client_id (and client_secret) under OAuth options.
  • Localhost vs remote callback: when accessing the console from localhost or 127.0.0.1, the popup completes sign-in automatically. On remote servers, use a loopback redirect URI such as http://127.0.0.1:1455/auth/callback and paste the final redirected URL into the Callback URL field in the provider dialog.
  • Direct plan-usage requirements: upstream requests target POST /v1/responses with stream: true and store: 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 401 response.
  • Model listing: fetching models queries GET /v1/models with 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-zen is the Console pay-as-you-go lane (https://opencode.ai/inference), and opencode-go is 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: Bearer is sent everywhere, plus the dialect's auth header where required (x-api-key for Anthropic, x-goog-api-key for Google). Identity headers (x-opencode-client, x-opencode-project, conversation-scoped x-opencode-session, and per-request x-opencode-request) are sent by default. The Zen lane keeps User-Agent: opencode/... for free-tier eligibility; the Go lane sends User-Agent: llm-proxy/<version>. Any of these can be overridden via Custom headers, including with an empty value.
  • Session affinity: x-opencode-session identifies 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, Codex session_id / thread-id, x-session-affinity, x-deepseek-harness-session-id, agent-session-id, or x-amp-thread-id), then body-level session_id / conversation_id / thread_id, then Anthropic metadata.user_id or prompt_cache_key, then a deterministic fingerprint of the first user message (with Copilot-style <environment_info> / <context> blocks stripped). Set x-opencode-session in 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/models returns bare IDs; display names, context windows, and pricing come from the models.dev catalog. Set provider metadata opencode_catalog_url to 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/responses and /v1/messages clients are forwarded verbatim, keeping reasoning.mode, reasoning.context, thinking budgets, context_management, provider routing preferences, plugins, models fallbacks, and usage accounting intact. Set provider metadata native_passthrough: false to fall back to Chat Completions translation.
  • Unified reasoning object: the proxy sends reasoning: {effort, mode, context, summary, max_tokens, exclude, enabled} instead of a bare reasoning_effort so Responses-only fields such as mode: "pro" survive. OpenRouter honors mode: "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 absolute http(s) URL.
  • Forwarded client headers: X-OpenRouter-Metadata, X-OpenRouter-Cache, X-OpenRouter-Cache-TTL, X-OpenRouter-Cache-Clear, x-session-id, and x-anthropic-beta (needed for Claude beta opt-ins such as structured-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 legacy route, transforms, usage, and include_reasoning. Embeddings preserve input_type, session_id, trace, provider, and user. Images preserve resolution, aspect_ratio, seed, input_references, and provider (normalized to output_format, background, output_compression). TTS preserves input_references and provider; STT preserves provider.
  • Response metadata: X-Generation-Id and X-OpenRouter-Cache-* headers are forwarded to the client; cost, cost_details, and is_byok from usage feed the cost record.
  • Model picker: the catalog is fetched with output_modalities=all so 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/translations is rejected locally because OpenRouter has no audio translation endpoint.
  • Model variants: :free, :nitro, :floor, :online, :thinking, and *-pro variants 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/models returns 404.
  • Chat vendor fields: unrecognized chat fields pass through to DashScope, so enable_thinking, thinking_budget, enable_search, search_options, tool_stream, and enable_code_interpreter work via extra_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 edits bbox_list, color_palette, enable_sequential, thinking_mode) are forwarded flat on the body. DashScope has no mask concept; pass bbox_list instead.
  • Embeddings: text-embedding-v1..v4 and qwen3.7-text-embedding use {base_url}/embeddings. dimensions and per-request row caps (20 for qwen3.7-text-embedding, 10 for v3/v4, 25 for v1/v2) are validated at the proxy.
  • No audio: /v1/audio/* against a qwen provider returns 400. Speech synthesis uses DashScope's native multimodal endpoint, and ASR (qwen3-asr-flash) uses /chat/completions with input_audio content parts.
  • Web search: set native_web_search: true to pass web_search tools to DashScope's Responses API (web_search, web_extractor, code_interpreter). On Chat Completions the proxy emits enable_search: true with DashScope's default search_options. On the Anthropic-compatible endpoint, DashScope runs web_search_20250305 only when the request includes its billing header in a system block (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_search server-side on the Responses endpoint only, and only for deepseek-v4-pro (deepseek-flash ignores 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_use and web_search_tool_result blocks survive replay, but DeepSeek's built-in tool list only includes function, so web_search_20250305 is not executed there.
  • Stateless Responses: DeepSeek has no previous_response_id. The proxy materializes stored turns into input items and falls back to Chat Completions translation for that turn, so materialized continuations cannot use server-side web_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, and reasoning pass through untouched (MiniMax-M3.1-Flash rejects disabled thinking directly upstream). On Chat Completions, translated thinking fields and reasoning_split are forwarded as-is.
  • reasoning_split: with it off, thinking content stays inside content wrapped in <think> tags instead of moving to reasoning_content.
  • Video input: M-series models accept image and video (video_url on Chat Completions, video blocks on Messages).
  • Service tier: MiniMax uses standard and priority (1.5× cost; unsupported on MiniMax-M3.1-Flash). Client values standard_only and default map to standard, priority stays priority, 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_tokens and POST /v1/responses/input_tokens are 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 by tool_call_id.
  • Sampling: top_p maps to p, stop maps to stop_sequences (at most 5), and temperature, max_tokens, frequency_penalty, presence_penalty, and seed map one-to-one. n > 1 is rejected to avoid multiplying billed requests.
  • Structured output: response_format with json_schema maps to {"type": "json_object", "json_schema": <schema>} (no strict flag). v2 cannot combine response_format with documents or tools.
  • Thinking: maps to {"type": "enabled"|"disabled", "token_budget": N}. Reasoning is on by default for supported models; disabled or none sends the off spelling, and token_budget is only set when explicitly provided.
  • Tools: function tools require parameters (defaulting to {}). tool_choice maps to REQUIRED or NONE (named choices become REQUIRED; auto omits the field). Hosted tools are dropped with a warning.
  • Cohere-only fields: documents, citation_options, safety_mode, strict_tools, priority, k, and logprobs pass through extra. RAG citations attach to the text block they cite.
  • Embeddings: v2 requires input_type (search_document by default; pass extra.input_type for search_query, classification, clustering, or image). dimensions maps to output_dimension and encoding_format: "base64" maps to embedding_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, and priority pass through extra.
  • Audio: /v2/audio/transcriptions requires language (ISO-639-1). prompt, response_format, timestamp granularities, and include are 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 > 1 and logprobs / top_logprobs are omitted (and logged) because current Gemini models reject them with 400.
  • Structured output: response_format: {"type": "json_schema", …} maps to generationConfig.responseFormat.text with full JSON Schema on Gemini 3+, and to sanitized responseMimeType + responseSchema on earlier versions.
  • Gemini-native fields: inject generationConfig, cachedContent, safetySettings, and similar fields through a model mapping's parameter_overrides. An injected generationConfig replaces the one the proxy builds, so include every field the request needs.
  • Batch mode: models/{model}:batchGenerateContent is 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, use service_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_search on Qwen, web_search body object on NanoGPT, web_search.search_engine on 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.

ProviderNative server-side searchReaches the upstream through
openaiResponses web_search; Chat web_search_options (search models)any client protocol (translated)
anthropicweb_search_20260318 / 20260209 / 20250305 server toolMessages (verbatim), Chat web_search_options, or any client declaring web_search
geminigoogle_search grounding (url_context / google_maps are separate tools)any client protocol
deepseekResponses web_search (only deepseek-v4-pro; see above)Responses (verbatim)
xaiResponses web_search (filters.allowed_domains / filters.excluded_domains) and x_searchResponses (verbatim)
qwen, qwen-intlResponses web_search / web_extractor; Chat enable_search + search_options; Anthropic server toolResponses and Anthropic (verbatim), Chat if the client sends enable_search
openrouterserver tool openrouter:web_search (parameters.*); Responses hoists plain web_search into itResponses and Messages (verbatim), Chat if the client sends the server-tool type or legacy plugins: [{"id": "web"}]
zai, zai-codingChat {"type": "web_search", "web_search": {"search_engine": ...}} (search_pro_jina)Chat Completions (verbatim)
zhipu, zhipu-codingsame Chat shape (search_std / search_pro / search_pro_sogou / search_pro_quark); Responses {"type": "web_search"}Chat (verbatim)
minimaxResponses {"type": "web_search"}; Anthropic {"type": "web_search_20250305", "name": "web_search"}Responses and Messages (verbatim); Chat has no server tools
nanogptResponses web_search; Chat body web_search: {"enabled": true, ...}Responses (verbatim), Chat body field
moonshotResponses {"type": "web_search"}; Chat $web_search (type: "builtin_function", deprecated — retires 2026-10-20)Chat ($web_search, legacy); Messages accepts only client tools
mistralnone on Chat Completionsproxy-side only
vllm, sglang, ollama, chutes, cohere, opencode-zen, opencode-gononeproxy-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 ​

DeclarationForwarded toDropped (with warning) everywhere else
google_search / google_search_retrievalGemini ({"google_search": {}})yes
url_context, google_mapsGemini (bare tool keys)yes
code_execution (Anthropic) / code_interpreter (OpenAI)Gemini ({"code_execution": {}}); native Responses wiresyes
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_extractorQwen Responses (verbatim; requires web_search alongside)yes
retrieval (knowledge_id)Z.ai / BigModel Chat Completionsyes
$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 ityes
unknown tool typesResponses or Gemini wires, verbatimdropped 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, and sglang need 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.

MIT licensed