Provider keys allow you to use your own API keys from LLM providers like OpenAI, Anthropic, Google, etc. This enables you to leverage your existing relationships and pricing with providers.
Create Provider Key
Provider ID (e.g., “openai”, “anthropic”, “google-vertex-ai”) or “custom” for custom providers
ID of the organization this key belongs to
Custom name for the provider (lowercase a-z only, required for custom providers)
Custom base URL (for custom providers or proxy endpoints)
Provider-specific configuration options aws_bedrock_region_prefix
'us.' | 'global.' | 'eu.'
AWS Bedrock region prefix
Model to use for validating Azure credentials
The created provider key with masked token Masked version of the API key
Provider-specific options
status
'active' | 'inactive' | 'deleted'
Current status
Associated organization ID
cURL - OpenAI
cURL - Azure OpenAI
cURL - Custom Provider
JavaScript
Python
curl -X POST https://api.llmgateway.io/keys/provider \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"token": "sk-proj-...",
"organizationId": "org_abc123"
}'
{
"providerKey" : {
"id" : "pk_xyz789" ,
"maskedToken" : "sk-proj-...xyz" ,
"provider" : "openai" ,
"name" : null ,
"baseUrl" : null ,
"options" : null ,
"status" : "active" ,
"organizationId" : "org_abc123" ,
"createdAt" : "2024-01-15T10:30:00Z" ,
"updatedAt" : "2024-01-15T10:30:00Z"
}
}
Provider keys are validated before creation. The system will test the key by making a test API call to the provider.
List Provider Keys
Retrieve all provider keys for organizations you belong to.
Array of provider key objects with masked tokens
curl https://api.llmgateway.io/keys/provider \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
"providerKeys" : [
{
"id" : "pk_xyz789" ,
"maskedToken" : "sk-proj-...xyz" ,
"provider" : "openai" ,
"name" : null ,
"baseUrl" : null ,
"options" : null ,
"status" : "active" ,
"organizationId" : "org_abc123" ,
"createdAt" : "2024-01-15T10:30:00Z" ,
"updatedAt" : "2024-01-15T10:30:00Z"
},
{
"id" : "pk_abc456" ,
"maskedToken" : "sk-ant-...def" ,
"provider" : "anthropic" ,
"name" : null ,
"baseUrl" : null ,
"options" : null ,
"status" : "active" ,
"organizationId" : "org_abc123" ,
"createdAt" : "2024-01-14T09:15:00Z" ,
"updatedAt" : "2024-01-14T09:15:00Z"
}
]
}
Update Provider Key Status
Activate or deactivate a provider key.
status
'active' | 'inactive'
required
New status for the provider key
curl -X PATCH https://api.llmgateway.io/keys/provider/pk_xyz789 \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status": "inactive"}'
{
"message" : "Provider key status updated to inactive" ,
"providerKey" : {
"id" : "pk_xyz789" ,
"maskedToken" : "sk-proj-...xyz" ,
"provider" : "openai" ,
"name" : null ,
"baseUrl" : null ,
"options" : null ,
"status" : "inactive" ,
"organizationId" : "org_abc123" ,
"createdAt" : "2024-01-15T10:30:00Z" ,
"updatedAt" : "2024-01-16T14:20:00Z"
}
}
Delete Provider Key
Soft-delete a provider key. The key will be marked as deleted and can no longer be used.
curl -X DELETE https://api.llmgateway.io/keys/provider/pk_xyz789 \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
{
"message" : "Provider key deleted successfully"
}
Supported Providers
The following providers are officially supported:
Provider ID Validation OpenAI openaiAutomatic Anthropic anthropicAutomatic Google Vertex AI google-vertex-aiAutomatic Azure OpenAI azure-openaiAutomatic AWS Bedrock aws-bedrockAutomatic Cohere cohereAutomatic Mistral mistralAutomatic Groq groqAutomatic Together AI together-aiAutomatic Custom customManual
For a complete list of supported providers, see the Providers documentation .
Custom Providers
You can add custom OpenAI-compatible providers:
Set provider to 'custom'
Use "provider": "custom" in your request
Provide a unique name
Choose a unique name (lowercase a-z only) for your provider
Specify the base URL
Provide the base URL for the OpenAI-compatible API
Add your API key
Include the API key from your custom provider
curl -X POST https://api.llmgateway.io/keys/provider \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"provider": "custom",
"name": "mycompany",
"token": "custom-api-key",
"baseUrl": "https://api.mycompany.com/v1",
"organizationId": "org_abc123"
}'
Custom providers are not automatically validated. Make sure your endpoint is OpenAI-compatible.
Error Responses
400 Bad Request - Duplicate Key
400 Bad Request - Invalid Key
403 Forbidden
404 Not Found
{
"message" : "A key for provider 'openai' already exists for this project"
}
Best Practices
Security
Rotate provider keys regularly
Use different keys for development and production
Monitor key usage via activity logs
Revoke keys immediately if compromised
Cost Management
Set usage limits on API keys that use these provider keys
Monitor spending through your provider’s dashboard
Enable auto-top-up to avoid service interruptions
High Availability
Configure multiple providers for redundancy
Use fallback routing in your Gateway API requests
Monitor provider status pages for outages