AI Providers
Manage AI provider configuration and bring-your-own-key (BYOK) API keys for drift analysis.
Base path: /api/auth (AI provider settings are managed under auth routes)
Authentication: Bearer token required on all routes
Provider Settings
Get AI Provider Settings
GET /api/auth/ai-provider
Get the current user's AI provider configuration.
Response
{
"success": true,
"data": {
"provider": "anthropic",
"model": "claude-sonnet-4-5-20250929",
"hasCustomKey": true
}
}Example
curl -H "Authorization: Bearer TOKEN" \
https://api.controlinfra.com/api/auth/ai-providerUpdate AI Provider Settings
PUT /api/auth/ai-provider
Update AI provider and model preferences.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
provider | string | Yes | AI provider (anthropic, openai) |
model | string | No | Model to use |
Example
curl -X PUT https://api.controlinfra.com/api/auth/ai-provider \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"provider": "anthropic", "model": "claude-sonnet-4-5-20250929"}'Anthropic API Key (BYOK)
Get Anthropic Key Status
GET /api/auth/anthropic-api-key
Check if the user has a stored Anthropic API key.
Response
{
"success": true,
"data": {
"hasKey": true,
"keyPrefix": "sk-ant-****"
}
}Save Anthropic Key
POST /api/auth/anthropic-api-key
Store an Anthropic API key for BYOK usage.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Anthropic API key |
Verify Anthropic Key
POST /api/auth/anthropic-api-key/verify
Verify that the stored Anthropic API key is valid and working.
Response
{
"success": true,
"data": {
"valid": true,
"model": "claude-sonnet-4-5-20250929"
}
}Delete Anthropic Key
DELETE /api/auth/anthropic-api-key
Remove the stored Anthropic API key.
OpenAI API Key (BYOK)
Get OpenAI Key Status
GET /api/auth/openai-api-key
Check if the user has a stored OpenAI API key.
Save OpenAI Key
POST /api/auth/openai-api-key
Store an OpenAI API key for BYOK usage.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | OpenAI API key |
Verify OpenAI Key
POST /api/auth/openai-api-key/verify
Verify that the stored OpenAI API key is valid.
Delete OpenAI Key
DELETE /api/auth/openai-api-key
Remove the stored OpenAI API key.