BazaarLinkBazaarLink
Sign in
DocsAPI ReferenceSDK ReferenceAgentic UsageAI Skills
Management Keys

Update a BYOK key

Updates one BYOK key: enable/disable, rename, switch fallback mode, per-model toggles (modelToggles), and reset the applicable scope (scopedApiKeyIds). All fields are optional; the upstream key itself cannot be replaced — delete and recreate to rotate it.

PATCH/api/v1/management/byok-keys/:id

Authorizations

Authorizationrequired
string · header

API key as bearer token in the Authorization header.

Path parameters

idrequired
string

The BYOK key id.

Body

enabled
boolean

Master switch for the whole key.

fallbackMode
string

Whether to fall back to platform routing when the upstream fails.

seamlessstrict
name
string

New display name.

1-200 chars
modelToggles
{canonicalId, enabled}[]

Per-model switches: each element names a canonicalId and enabled. Only listed models change; the rest keep their state.

≤2000 items
scopedApiKeyIds
string[]

Replaces the whole scope list: an empty array restores org-wide applicability. Including a key id you don't own answers 400.

≤200 items; must be your own keys
PATCH /api/v1/management/byok-keys/:id
curl -X PATCH https://bazaarlink.ai/api/v1/management/byok-keys/byok_abc123 \
  -H "Authorization: Bearer $BAZAARLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fallbackMode": "strict", "modelToggles": [{"canonicalId": "openai/gpt-4o", "enabled": false}]}'
Response examples

Updated — returns the updated { key }.

{
  "key": {
    "id": "byok_abc123",
    "ownerType": "org",
    "userId": null,
    "organizationId": "org_abc123",
    "name": "team-upstream",
    "baseUrl": "https://api.example-upstream.com/v1",
    "keyMask": "sk-abc…wxyz",
    "protocol": "openai",
    "enabled": true,
    "fallbackMode": "strict",
    "modelsStale": false,
    "lastVerifiedAt": "2026-07-29T00:00:00.000Z",
    "lastErrorAt": null,
    "lastErrorCode": null,
    "errorCount1h": 0,
    "createdAt": "2026-07-29T00:00:00.000Z",
    "updatedAt": "2026-07-29T00:00:00.000Z",
    "models": [
      {
        "canonicalId": "openai/gpt-4o",
        "upstreamModelId": "gpt-4o",
        "enabled": true
      }
    ],
    "scopedApiKeyIds": []
  }
}
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
Update a BYOK key — BazaarLink API