Providers

BYOK provider management — register, test, list, and remove API keys.

Endpoints

MethodPathAuthDescription
GET/v1/providers/catalogNoneList all supported providers
POST/v1/providers/testNoneValidate a provider key
POST/v1/providersAPI KeyRegister a provider key (BYOK)
GET/v1/providersAPI KeyList configured providers
DELETE/v1/providers/:providerIdAPI KeyRemove a provider key

List catalog

Returns all supported providers. No authentication required.

curl https://api.brainstormrouter.com/v1/providers/catalog
{
  "providers": [
    {
      "id": "anthropic",
      "name": "Anthropic",
      "api": "anthropic-messages",
      "base_url": "https://api.anthropic.com/v1",
      "env_key": "ANTHROPIC_API_KEY",
      "discoverable": true,
      "auth": "api-key"
    }
  ],
  "total": 30
}

Test a key

Validate a provider API key without storing it.

curl -X POST https://api.brainstormrouter.com/v1/providers/test \
  -H "Content-Type: application/json" \
  -d '{"provider": "openai", "api_key": "sk-..."}'
{ "valid": true, "provider": "openai", "name": "OpenAI", "status": 200 }

Register a key

Store an encrypted provider key. Rotates any existing key for the same provider.

curl -X POST https://api.brainstormrouter.com/v1/providers \
  -H "Authorization: Bearer br_live_..." \
  -H "Content-Type: application/json" \
  -d '{"provider": "groq", "api_key": "gsk_..."}'
{
  "id": "uuid",
  "provider": "groq",
  "name": "Groq",
  "masked_key": "gsk-...xyz4",
  "status": "active"
}

List configured providers

Returns providers with masked keys. Plaintext keys are never returned.

curl https://api.brainstormrouter.com/v1/providers \
  -H "Authorization: Bearer br_live_..."

Remove a provider

Deactivates the key (preserved for audit).

curl -X DELETE https://api.brainstormrouter.com/v1/providers/groq \
  -H "Authorization: Bearer br_live_..."