Custom Providers
Connect an endpoint using the adapter that matches its actual API protocol. A similar model name does not make incompatible request formats interchangeable.
| Provider value | Protocol | Default path |
|---|---|---|
custom-openai | OpenAI-compatible chat completions | /v1/chat/completions |
custom-gemini | Native Gemini content/parts | /v1beta/models/{modelId}:generateContent |
custom-anthropic | Anthropic Messages | /v1/messages |
All three have implemented providers. Compatibility still depends on the upstream endpoint’s supported options, tool schemas, streaming, and model capabilities.
Model configuration
Section titled “Model configuration”{ name: 'internal-chat', modelId: 'your-model-id', provider: 'custom-openai', endpoint: 'https://models.example.com', apiKeyRef: 'internal_model_key', metadata: { customProvider: { auth: { type: 'bearer' }, // pathOverride: '/v1/chat/completions', // extraHeaders: { 'X-Org': 'example' }, }, },}Configuration is stored on each model row, so models can use different endpoints and credentials.
| Authentication type | Additional setting | Request |
|---|---|---|
bearer | None | Authorization: Bearer ... |
header | headerName | Named header containing the key |
query | paramName | Named query parameter containing the key |
apiKeyRef accepts env:VARIABLE_NAME for an environment lookup or a system-vault secret name. Provider-specific fallback variables are CUSTOM_OPENAI_API_KEY, CUSTOM_GEMINI_API_KEY, and CUSTOM_ANTHROPIC_API_KEY. Prefer the vault for persisted credentials; query authentication can expose credentials in upstream access logs.
Native Gemini and Vertex
Section titled “Native Gemini and Vertex”The Gemini adapter sends contents, systemInstruction, generationConfig, and tools.functionDeclarations, and reads candidates[].content.parts[]. Streaming uses the corresponding streamGenerateContent path. The former gemini-blocks-config request envelope is no longer supported; migrate proxies to a supported protocol or implement an adapter.
For Google Vertex AI, use the first-class vertex provider when service-account authentication is required. It handles JWT/bearer authentication and Vertex resource paths; a custom Gemini API-key configuration is not a substitute for that authentication flow.
Verify before routing work
Section titled “Verify before routing work”Use the Models page’s connectivity test, then test the features you need: text completion, streaming, tools, and any media inputs. A connectivity success alone does not establish feature compatibility. Custom adapters do not provide a general-purpose embeddings implementation.
See Model Management and LiteLLM Proxy.