Set BYOK key
Store a tenant-supplied LLM provider API key (BYOK) for the project. The key is stored in memory and used instead of the shared platform key for all LLM calls in this project. Paid plans only (Pro and above) - see web/public/llms.txt § ‘All paid plans include BYOK’. Free-tier tenants in the treatment cohort of the BYOK experiment may also set a key after a successful live probe (KF_FREE_BYOK_COHORT).
Body
PUT /v1/projects/{project_id}/byok
LLM provider API key
1LLM provider name (e.g. openai, anthropic)
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.
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.
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