OpenAI-Compatible Custom Endpoints
Configuration Format
Use thecustom: prefix followed by your API base URL:
URL Parsing and Validation
From~/workspace/source/clients/agent-runtime/src/providers/mod.rs:358:
Supported URL Formats
Base URL Only
The provider appends/chat/completions automatically:
With Version Path
Full Endpoint Path
If the URL already ends with/chat/completions, it’s used as-is:
Localhost and HTTP
For local development:Authentication Options
Custom providers use Bearer token authentication by default:- Explicit
api_keyin config - Provider-specific environment variable (if mapped)
CORVUS_API_KEYAPI_KEY
api_key:
Example Implementations
LiteLLM Proxy
LiteLLM provides a unified OpenAI-compatible interface to 100+ LLMs:Ollama (Remote)
Connect to a remote Ollama instance:vLLM Server
vLLM provides OpenAI-compatible serving:LocalAI
LocalAI compatible setup:Azure OpenAI
For Azure OpenAI deployments:OpenRouter (Direct)
While OpenRouter has a dedicated provider, you can also use custom:Anthropic-Compatible Custom Endpoints
Configuration Format
Use theanthropic-custom: prefix:
Implementation
From~/workspace/source/clients/agent-runtime/src/providers/mod.rs:552:
Use Cases
Anthropic Proxy
For rate limiting or monitoring:AWS Bedrock (via proxy)
Programmatic Usage
Basic Custom Provider
Advanced with Compatible Provider
Direct construction for more control:Custom Authentication Styles
For providers with non-standard auth:Advanced Configuration
Non-Standard Endpoint Paths
Some providers use custom paths instead of/v1/chat/completions:
Disable Responses API Fallback
Some providers don’t support the/v1/responses endpoint:
Custom Timeouts
Custom providers inherit these defaults:- Request timeout: 120 seconds
- Connect timeout: 10 seconds
With Resilient Provider Chain
Use custom providers with automatic failover:Validation and Error Handling
URL Validation Errors
custom: prefix.
Solution: Provide a valid URL.
ftp://, ws://).
Solution: Use http:// or https://.
Testing Custom Endpoints
Verify your endpoint works:Best Practices
- Test endpoints manually before configuring Corvus
- Use https:// for production deployments
- Store API keys in environment variables, not config files
- Use dedicated Ollama provider instead of custom for Ollama servers
- Enable fallback providers for reliability
- Document custom provider details for your team
- Monitor endpoint health and response times
- Use rate limiting on custom proxies
- Implement authentication for production endpoints
- Version your API endpoints (e.g.,
/v1,/v2)
Common Use Cases
Development and Testing
On-Premise Deployment
Multi-Region Routing
Cost Optimization Gateway
Security Considerations
- Validate SSL certificates in production (automatic with
https://) - Use strong API keys for authentication
- Rotate credentials regularly
- Monitor access logs on custom endpoints
- Implement rate limiting to prevent abuse
- Use firewalls to restrict endpoint access
- Encrypt credentials at rest (Corvus supports encrypted secrets)
- Never commit API keys to version control
- Use environment variables or secret management systems
- Audit custom provider usage regularly
Troubleshooting
Connection Refused
SSL/TLS Errors
- Ensure the endpoint has a valid SSL certificate
- For development, use
http://localhostinstead
Authentication Errors
- Verify the API key is correct
- Check the authentication method (Bearer vs x-api-key)
Model Not Found
- Verify the model name matches what the endpoint expects
- Check endpoint documentation for available models