Set or rotate the tenant's AI provider key
PUT
/api/v1/ai/credential
const url = 'https://app.avera.io/api/v1/ai/credential';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"apiKey":"example","provider":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://app.avera.io/api/v1/ai/credential \ --header 'Content-Type: application/json' \ --data '{ "apiKey": "example", "provider": "example" }'BYOK: the tenant brings its own AI provider key, and spend goes to the provider. The key is validated against the provider before it is persisted, so a typo fails here rather than mid-generation. The key is stored write-only and never returned by any endpoint. Tenant-admin gated.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
apiKey
required
string
provider
string | null
Example generated
{ "apiKey": "example", "provider": "example"}Responses
Section titled “Responses”OK
Media type*/*
object
configured
required
boolean
provider
string | null
keyPrefix
string | null
createdAt
string | null format: date-time
rotatedAt
string | null format: date-time
lastValidatedAt
string | null format: date-time
lastUsedAt
string | null format: date-time