Authentication
All LLM provider endpoints require authentication and specific permissions:llm_provider.view- View provider configurationsllm_provider.create- Create new providersllm_provider.edit- Update provider settingsllm_provider.delete- Delete providersllm_provider.test- Test provider connections
Provider Types
Supported provider types:- anthropic - Anthropic Claude models
- openai - OpenAI GPT models
- google - Google Gemini models
- custom - Custom OpenAI-compatible endpoints
Custom Authentication Types
For custom providers, the following authentication methods are supported:- none - No authentication required
- bearer - Bearer token authentication
- basic - Basic HTTP authentication
- api_key_header - Custom API key header
LLM Provider Object
Unique identifier for the provider (UUID)
Display name for the provider (1-100 characters)
Type of provider:
anthropic, openai, google, or customBase URL for API calls. Optional for standard providers, required for custom endpoints.Default URLs:
- Anthropic:
https://api.anthropic.com - OpenAI:
https://api.openai.com - Google:
https://generativelanguage.googleapis.com
Indicates if an API key is configured. The actual key is never returned in responses.
Provider-specific configuration object. May include custom headers, timeouts, or other settings.
Array of available model identifiers (e.g.,
["claude-3-5-sonnet-20241022", "gpt-4o"])Whether the provider is currently enabled and available for use
Whether this is the default provider for new conversations
ISO 8601 timestamp of the last health check
Status of the last health check:
success or errorError message from the last health check (if failed)
ISO 8601 timestamp when the provider was created
ISO 8601 timestamp of the last update
List All Providers
Returns a list of all LLM providers. Use theactive_only query parameter to filter for only enabled providers.
Required Permission: llm_provider.view
Query Parameters
If
true, only returns providers where is_active is trueResponse
Array of LLM provider objects
Total count of providers returned
Example Request
Example Response
Create Provider
Creates a new LLM provider. API keys are automatically encrypted before storage. If the models array is empty, default models for the provider type will be used. Required Permission:llm_provider.create
Request Body
Display name for the provider (1-100 characters)
Provider type:
anthropic, openai, google, or customAPI key for authentication. Will be encrypted before storage.
Custom base URL. Optional for standard providers, required for
custom type.Provider-specific configuration (custom headers, timeouts, etc.)
Array of model identifiers. If empty, defaults are used:Anthropic defaults:
claude-opus-4-5-20251101claude-sonnet-4-20250514claude-3-5-sonnet-20241022claude-3-5-haiku-20241022claude-3-opus-20240229claude-3-sonnet-20240229claude-3-haiku-20240307
gpt-4ogpt-4o-minigpt-4-turbogpt-4gpt-3.5-turboo1-previewo1-mini
gemini-2.5-progemini-2.5-flashgemini-2.0-flashgemini-2.0-flash-lite-001gemini-1.5-progemini-1.5-flash
Enable the provider immediately after creation
Set as the default provider for new conversations
Response
Returns the created LLM provider object with status code201 Created.
Example Request
Example Response
Get Available Models
Aggregates models from all active providers into a single list. Each model includes its provider information for UI selection. Required Permission:llm_provider.view
Response
Array of available model objects
Model Object
UUID of the provider
Display name of the provider
Type of provider:
anthropic, openai, google, or customModel identifier (e.g., “claude-3-5-sonnet-20241022”)
Human-readable model name
Whether this model’s provider is the default
Example Request
Example Response
Get Provider by ID
Fetches detailed information about a single LLM provider. API keys are never returned in responses. Required Permission:llm_provider.view
Path Parameters
UUID of the provider to retrieve
Response
Returns the LLM provider object or404 Not Found if the provider doesn’t exist.
Example Request
Example Response
Error Response
Update Provider
Updates a provider configuration. Only provided fields are updated; omitted fields remain unchanged. To update the API key, include it in the request. Required Permission:llm_provider.edit
Path Parameters
UUID of the provider to update
Request Body
All fields are optional. Only include fields you want to update.New display name (1-100 characters)
Updated base URL
New API key (will be encrypted). Omit to keep existing key.
Updated configuration object
Updated list of model identifiers
Enable or disable the provider
Set or unset as default provider
Response
Returns the updated provider object or404 Not Found if the provider doesn’t exist.
Example Request
Example Response
Delete Provider
Permanently removes a provider and its configuration. This action cannot be undone. Required Permission:llm_provider.delete
Path Parameters
UUID of the provider to delete
Response
Returns204 No Content on success or 404 Not Found if the provider doesn’t exist.
Example Request
Success Response
Status:204 No Content (no body)
Error Response
Test Provider Connection
Performs a health check by attempting to connect to the provider’s API. Updates the provider’s health check status in the database. Required Permission:llm_provider.test
Path Parameters
UUID of the provider to test
Response
Whether the health check succeeded
UUID of the tested provider
Status of the health check:
success or errorError message if the test failed
Response time in milliseconds
Example Request
Success Response
Error Response
Discover Models from Provider
Fetches the list of available models directly from the provider’s API endpoint. Requires valid credentials to be configured. Required Permission:llm_provider.view
Path Parameters
UUID of the provider to query for models
Response
Whether the discovery succeeded
Array of model identifier strings discovered from the provider
Status or error message
Example Request
Success Response
Error Response
Discover Models from New Config
Use this endpoint to test provider credentials and discover available models before creating a provider configuration. Accepts the same payload as provider creation but only performs discovery. Required Permission:llm_provider.create
Request Body
Accepts the same fields as the Create Provider endpoint:Provider type:
anthropic, openai, google, or customAPI key for authentication (not saved)
Custom base URL (for custom providers)
Provider-specific configuration
Provider name (required but not used for discovery)
Not used for discovery
Not used for discovery
Not used for discovery
Response
Whether the discovery succeeded
Array of model identifier strings discovered from the provider
Status or error message
Example Request
Success Response
Error Response
Use Case
This endpoint is particularly useful for:- Pre-validation - Test credentials before creating a provider
- UI workflows - Populate model selection dropdowns dynamically
- Custom providers - Verify OpenAI-compatible endpoints return valid model lists
- Troubleshooting - Diagnose authentication or connectivity issues