Skip to content

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 valueProtocolDefault path
custom-openaiOpenAI-compatible chat completions/v1/chat/completions
custom-geminiNative Gemini content/parts/v1beta/models/{modelId}:generateContent
custom-anthropicAnthropic Messages/v1/messages

All three have implemented providers. Compatibility still depends on the upstream endpoint’s supported options, tool schemas, streaming, and model capabilities.

{
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 typeAdditional settingRequest
bearerNoneAuthorization: Bearer ...
headerheaderNameNamed header containing the key
queryparamNameNamed 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.

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.

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.