Assistiv Docs

LLM Configurations

Configure LLM provider API keys for your platform. Each provider key is encrypted with AES-256-GCM before storage and decrypted at runtime by the inference service.

How Provider Routing Works

When an end user requests a model (e.g. gpt-4o), the inference service:

  1. Looks up all enabled model_provider_configs for that model slug
  2. Finds your platform's active provider key for the matching provider
  3. Decrypts the API key
  4. Routes the request to the provider

Providers and models are managed by the system admin via /v1/admin/providers and /v1/admin/models. Platform owners only need to add their own provider API keys.

GET/v1/platforms/{platformId}/llm-configs

Lists provider key configurations for the platform. API keys are never returned.

Auth: Platform key.

bash
curl https://api.assistiv.ai/v1/platforms/{platformId}/llm-configs \
  -H "Authorization: Bearer sk-plat_your_key"
json
{
  "data": [
    {
      "id": "uuid",
      "platform_id": "uuid",
      "provider_id": "uuid",
      "is_default": true,
      "is_active": true,
      "created_at": "2025-01-15T10:30:00Z"}
  ],
  "total": 1, "page": 1, "limit": 20
}
POST/v1/platforms/{platformId}/llm-configs

Adds a provider API key. The key is encrypted before storage.

Auth: Platform key.

Request Body

NameTypeRequiredDescription
provider_idstringRequiredUUID of the provider (OpenAI, Anthropic, etc.).
api_keystringRequiredYour provider API key. Encrypted with AES-256-GCM before storage.
is_defaultbooleanOptionalSet as the default key for this provider on your platform.Default: false

Security

Provider API keys are encrypted at rest and never returned in API responses. Only the metadata (provider, default status, active status) is visible.

bash
curl -X POST https://api.assistiv.ai/v1/platforms/{platformId}/llm-configs \
  -H "Authorization: Bearer sk-plat_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "provider_id": "provider-uuid-for-openai",
    "api_key": "sk-openai-your-key-here",
    "is_default": true
  }'
PATCH/v1/platforms/{platformId}/llm-configs/{configId}

Updates a provider key configuration. Triggers cache invalidation.

Auth: Platform key.

Request Body

NameTypeRequiredDescription
api_keystringOptionalNew provider API key (will be re-encrypted).
is_defaultbooleanOptionalUpdate default status.
is_activebooleanOptionalEnable or disable this key.
bash
curl -X PATCH https://api.assistiv.ai/v1/platforms/{platformId}/llm-configs/{configId} \
  -H "Authorization: Bearer sk-plat_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "sk-openai-new-key",
    "is_default": true,
    "is_active": true
  }'
DELETE/v1/platforms/{platformId}/llm-configs/{configId}

Deletes a provider key configuration. Triggers cache invalidation.

Auth: Platform key. Returns 204 No Content.

bash
curl -X DELETE https://api.assistiv.ai/v1/platforms/{platformId}/llm-configs/{configId} \
  -H "Authorization: Bearer sk-plat_your_key"