Create a BYOK key
Creates a BYOK upstream key for the organization and immediately syncs the model catalog. The upstream apiKey appears in plaintext only in this request — it is encrypted at rest and only ever returned masked (keyMask). On success answers 201 with the key object and the model sync result (sync).
/api/v1/management/byok-keysAuthorizations
AuthorizationrequiredAPI key as bearer token in the Authorization header.
Body
namerequiredDisplay name for the key.
baseUrlrequiredThe upstream provider's API base URL. Private or local addresses are rejected (400).
apiKeyrequiredThe upstream provider's API key in plaintext. Appears only in this request; encrypted at rest, only keyMask is returned afterwards.
protocolThe upstream's API interface protocol; defaults to openai.
openaianthropic"openai"fallbackModeBehavior when the upstream fails: seamless (default) falls back to platform routing; strict does not fall back and returns the error.
seamlessstrict"seamless"disabledCanonicalIdsModels (canonical ids) to disable at creation; after sync these models will not route through this key.
scopedApiKeyIdsRestricts this BYOK key to specific platform API keys (by key id). Empty/omitted = applies to every key of the org. Including a key id you don't own is rejected (400).