POST/api/v1/keys

Create an API key

Needs a provisioning key (403 otherwise). Returns the plaintext key exactly once. The whole body is validated before the key is minted. limit is a USD spend cap resetting each limit_reset UTC window (default daily). identity_id must be an active identity of your organization (404 unknown, 409 disabled); omitted, the default identity is used.

認証: AuthorizationヘッダーにBearer形式のAPIキー

リクエストボディ

  • namestring必須

    1 to 80 characters after trimming.

  • limitnumber | null

    Spend cap, USD.

  • limit_resetenum

    Cap window; default daily. Null is refused.

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

    Accepted for compatibility; ignored.

  • provisioningboolean

    Mint a provisioning key (can manage keys).

    デフォルト: false
  • identity_idstring | null

    Active identity of your organization; null for the default.

レスポンス

  • 200

    The created key and its one-time plaintext.

    レスポンス
    • dataobject必須
      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
    • keystring必須

      The plaintext key, returned only here.

  • 400

    Name not 1 to 80 characters, negative or oversized limit, unknown or null limit_reset.

    レスポンス
    • errorstring必須

      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.

    レスポンス
    • errorstring必須

      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

    Not a provisioning key, or the mint is refused for this identity or deployment.

    レスポンス
    • errorstring必須

      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

    The resource does not exist or belongs to another organization.

    レスポンス
    • errorstring必須

      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).

  • 409

    The write conflicts with the current state (for example a concurrent change or a duplicate name).

    レスポンス
    • errorstring必須

      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.

    レスポンス
    • detailarray<object>必須
      detail
      • typestring
      • locarray<string | integer>
      • msgstring

リクエスト

curl -X POST https://api.experientiallabs.ai/api/v1/keys \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "customer-4821",
  "limit": 25,
  "limit_reset": "monthly",
  "identity_id": "7a3e1c90-4b2d-4f6a-9e18-2d5c0b7f3a61"
}'

レスポンス

{
  "data": {
    "hash": "5d8a2f71-0c4e-4b9a-8e36-1f7b2c9d4a05",
    "name": "customer-4821",
    "label": "xpl_live_3b7e…04fc",
    "disabled": false,
    "is_provisioning": false,
    "identity_id": "7a3e1c90-4b2d-4f6a-9e18-2d5c0b7f3a61",
    "limit": 25,
    "limit_remaining": 25,
    "limit_reset": "monthly",
    "usage": null,
    "created_at": "2026-11-19T16:10:03.220Z",
    "updated_at": "2026-11-19T16:10:03.220Z"
  },
  "key": "xpl_live_3b7e9c2a5f1d8e4b6a0c7f3e2d9b1a5c04fc"
}

https://api.experientiallabs.ai/api/v1/keys