Skip to main content
POST
/
api
/
ai-models
/
organization
/
{organizationId}
/
api-key
Set or update API key for a provider
curl --request POST \
  --url https://your-instance.example.com/api/ai-models/organization/{organizationId}/api-key \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "provider": "anthropic",
  "apiKey": "sk-ant-api03-AbCdEf1234567890XyZ",
  "isEnabled": true
}
'
{
  "success": true,
  "message": "API key for anthropic updated successfully",
  "data": {
    "provider": "anthropic",
    "isEnabled": true,
    "hasApiKey": true
  }
}

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
provider
enum<string>
required

Provider whose key is being set, identified by its vercelUniqueName.

Available options:
anthropic,
openai,
google
apiKey
string
required

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

isEnabled
boolean

Whether the provider should be active immediately after the key is stored. Defaults to true when omitted.

Response

API key updated

Returned after a provider API key is set or updated.

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