Skip to main content
PUT
Set BYOK key

Body

application/json

PUT /v1/projects/{project_id}/byok

api_key
string
required

LLM provider API key

Minimum string length: 1
provider
string
default:openai

LLM provider name (e.g. openai, anthropic)

provider_url
string | null

Optional custom LLM provider base URL (e.g. for self-hosted OpenAI-compatible endpoints). Must be an HTTPS URL that passes SSRF validation - internal network addresses, cloud metadata endpoints, and non-HTTPS schemes are rejected.

model_preference
string | null

Optional specific model the tenant prefers from their provider (a provider model id). Used as a hint when routing - if the model cannot satisfy the request's capability requirements, normal model selection is applied.

allow_platform_fallback
boolean
default:true

When False, requests that cannot be satisfied by the tenant's BYOK key fail with an explicit error instead of silently falling back to the platform's shared key. Defaults to True (permissive) to preserve current behavior.

Response

BYOK key stored

BYOK key status (never exposes the actual key).

project_id
string
required
has_key
boolean
required
source
string
required
provider
string | null
key_preview
string | null
model_preference
string | null
allow_platform_fallback
boolean
default:true
probe_status
string | null
model_warning
string | null