Skip to main content
POST
/
api
/
ai-models
/
organization
/
{organizationId}
/
provider
Add AI provider to organization
curl --request POST \
  --url https://your-instance.example.com/api/ai-models/organization/{organizationId}/provider \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "aiModel": "5f7b1c2e8a1d4e0012c3b4a5",
  "modelDetail": "claude-sonnet-4-6",
  "apiKey": "sk-ant-api03-AbCdEf1234567890XyZ"
}
'
{
  "success": true,
  "data": {
    "aiProviders": [
      {
        "_id": "65f9b1c2e8a1d4e001a0b1c3",
        "aiModel": "5f7b1c2e8a1d4e0012c3b4a5",
        "modelDetail": "claude-sonnet-4-6",
        "apiKey": "sk-a••••••••f9d2"
      }
    ],
    "currentAiProviderIndex": 0,
    "currentAiModelIndex": 0,
    "currentAiModelVercelUniqueName": "anthropic"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

organizationId
string
required

Body

application/json
aiModel
string
required

ObjectId of the AiModel registry entry (provider) to attach to this organization.

modelDetail
string
required

modelName to use within the chosen provider; must exist in that AiModel's modelDetails.

apiKey
string
required

Provider API key; stored encrypted and never returned in GET responses.

Response

Provider added

success
enum<boolean>
required
Available options:
true
data
object
required