LLM Providers
Configure the language model providers that power your agents. Each provider config stores an encrypted API key and exposes a test endpoint. Agents reference providers by their configured name.
Base path: /api/llm-providers
All endpoints require Authorization: Bearer <token>.
API Key Security
API keys are encrypted at rest using AES-GCM-256. They are never returned in plaintext after creation — the key field is always masked as "***" in read responses.
Supported Providers
| Provider | Models |
|---|---|
openai | GPT-4o, GPT-4o-mini, o1, o3 |
anthropic | Claude Opus, Sonnet, Haiku |
google | Gemini 2.0, Gemini Flash |
xai | Grok-2, Grok-2 Vision |
mistral | Mistral Large, Small, Codestral |
deepseek | DeepSeek-V3, DeepSeek-R1 |
cohere | Command R+, Command R |
moonshot | Moonshot v1 |
minimax | MiniMax Text, MiniMax Vision |
zai | ZAI models |
nvidia | NVIDIA NIM endpoints |
openrouter | 100+ models via OpenRouter routing |
claude-code | Claude Code (agentic coding) |
ollama | Local Ollama models |
groq | Llama 3.3, Mixtral (Groq inference) |
cerebras | Llama 3.1 (Cerebras inference) |
custom | Any OpenAI-compatible endpoint |
List Providers
GET /api/llm-providersQuery parameters: provider, status, limit, offset
Response:
{
"success": true,
"data": [
{
"id": "llm_01J...",
"name": "Primary Anthropic",
"provider": "anthropic",
"model": "claude-sonnet-4-6",
"status": "active",
"isDefault": true,
"createdAt": "2026-02-01T09:00:00Z"
},
{
"id": "llm_02J...",
"name": "Groq Fast",
"provider": "groq",
"model": "llama-3.3-70b-versatile",
"status": "active",
"isDefault": false,
"createdAt": "2026-03-10T14:00:00Z"
}
]
}curl:
curl "https://api.cortex.acrobi.com/api/llm-providers" \
-H "Authorization: Bearer <token>"Create Provider
POST /api/llm-providersRequest body:
{
"name": "Primary Anthropic",
"provider": "anthropic",
"apiKey": "sk-ant-...",
"model": "claude-sonnet-4-6",
"baseUrl": null,
"isDefault": true,
"config": {
"maxTokens": 8192,
"temperature": 0.7
}
}| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Human-readable label |
provider | string | Yes | Provider identifier (see table above) |
apiKey | string | Yes | API key — encrypted immediately on receipt |
model | string | No | Default model to use with this provider |
baseUrl | string | No | Custom base URL (required for ollama, custom) |
isDefault | boolean | No | Make this the org-default provider |
config | object | No | Provider-specific defaults (temperature, maxTokens, etc.) |
Response: 201 Created
{
"success": true,
"data": {
"id": "llm_01J...",
"name": "Primary Anthropic",
"provider": "anthropic",
"model": "claude-sonnet-4-6",
"apiKey": "***",
"status": "active",
"isDefault": true,
"createdAt": "2026-04-03T12:00:00Z"
}
}curl:
curl -X POST "https://api.cortex.acrobi.com/api/llm-providers" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Primary Anthropic",
"provider": "anthropic",
"apiKey": "sk-ant-...",
"model": "claude-sonnet-4-6",
"isDefault": true
}'Get Provider
GET /api/llm-providers/:idResponse:
{
"success": true,
"data": {
"id": "llm_01J...",
"name": "Primary Anthropic",
"provider": "anthropic",
"model": "claude-sonnet-4-6",
"apiKey": "***",
"baseUrl": null,
"isDefault": true,
"status": "active",
"config": {
"maxTokens": 8192,
"temperature": 0.7
},
"createdAt": "2026-02-01T09:00:00Z",
"updatedAt": "2026-04-03T12:00:00Z"
}
}Update Provider
PATCH /api/llm-providers/:idTo rotate an API key, include apiKey in the body — it will be re-encrypted.
Request body:
{
"model": "claude-opus-4-6",
"apiKey": "sk-ant-new-key...",
"config": { "maxTokens": 16384 }
}Response: 200 OK — returns updated provider with apiKey: "***".
Delete Provider
DELETE /api/llm-providers/:idAgents referencing this provider will fall back to the org default.
Response:
{ "success": true }Test Connection
Sends a minimal inference request to verify the API key is valid and the provider is reachable.
POST /api/llm-providers/:id/testNo request body required.
Response: 200 OK
{
"success": true,
"data": {
"connected": true,
"provider": "anthropic",
"model": "claude-sonnet-4-6",
"latencyMs": 312,
"responsePreview": "Hello! I'm Claude..."
}
}If the key is invalid:
{
"success": false,
"data": {
"connected": false,
"provider": "anthropic",
"error": "401 authentication_error: invalid x-api-key"
}
}curl:
curl -X POST "https://api.cortex.acrobi.com/api/llm-providers/llm_01J.../test" \
-H "Authorization: Bearer <token>"