PATCH/api/v1/keys/{hash}

Update an API key

Needs a provisioning key (403 otherwise). disabled: true revokes the key permanently; disabled: false on a revoked key is 400. limit: null removes the cap; an omitted limit_reset keeps the existing cap's period. include_byok_in_limit is accepted for compatibility and has no effect.

Authentication: Bearer API key in the Authorization header

Path parameters

  • hashstringrequired

    The key id (hash in key objects).

Request body

  • namestring | null

    1 to 80 characters after trimming.

  • disabledboolean | null

    True revokes permanently.

  • limitnumber | null

    Spend cap, USD; explicit null removes the cap.

  • limit_resetenum
    "daily""weekly""monthly""yearly"null
  • include_byok_in_limitboolean | null

    Accepted for compatibility; ignored.

Responses

  • 200

    The updated key.

    Response
    • dataobjectrequired
      data
      • hashstring

        The key id (never the secret hash).

      • namestring
      • labelstring

        Key prefix and last characters.

      • disabledboolean

        True once revoked.

      • is_provisioningboolean
      • identity_idstring | null
      • limitnumber | null

        Spend cap, USD; null when uncapped.

      • limit_remainingnumber | null

        Cap less this window's spend and reservations, USD; null when uncapped or unreadable in time.

      • limit_resetenum | null
      • usagenull

        Always null; see GET /api/v1/usage.

      • created_atstring
      • updated_atstring
  • 400

    Invalid name, limit or period, or an attempt to re-enable a revoked key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 401

    Missing, unknown or revoked API key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 403

    The key is valid but may not perform this action (for example an inference key on a provisioning-key route, or a feature outside your plan).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 404

    No key with this id in your organization.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 422

    The body or query failed validation.

    Response
    • detailarray<object>required
      detail
      • typestring
      • locarray<string | integer>
      • msgstring

Request

curl -X PATCH https://api.experientiallabs.ai/api/v1/keys/0b9d4f6e-2a1c-4e8b-9f37-5c6d2e1a8b40 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "billing-sync-v2",
  "limit": 100,
  "limit_reset": "weekly"
}'

Response

{
  "data": {
    "hash": "0b9d4f6e-2a1c-4e8b-9f37-5c6d2e1a8b40",
    "name": "billing-sync-v2",
    "label": "xpl_live_8f2c…a91d",
    "disabled": false,
    "is_provisioning": false,
    "identity_id": "7a3e1c90-4b2d-4f6a-9e18-2d5c0b7f3a61",
    "limit": 100,
    "limit_remaining": 91.4,
    "limit_reset": "weekly",
    "usage": null,
    "created_at": "2026-11-02T09:14:22.501Z",
    "updated_at": "2026-11-02T09:14:22.501Z"
  }
}

https://api.experientiallabs.ai/api/v1/keys/0b9d4f6e-2a1c-4e8b-9f37-5c6d2e1a8b40