Spend Limits

Update a spend limit

Changed on

Replaces the value of the existing limit for the product and period. Send exactly one of amount and unlimited: true. The period's spend is checked at once: raising the limit above the spend lifts the period's block (evaluation.released), and lowering it below the spend blocks the product (evaluation.blocked_now). Returns 404 when no limit is set; create it instead. With the credential_id query parameter, the request changes that API key's limit; it needs an amount, and raising it is subject to the allocation rule.

patch/spend_limits/{product}

Request

  • Base URL
    https://api.telnyx.com/v2
  • URL
    https://api.telnyx.com/v2/spend_limits/{product}
  • Auth
    HTTP bearer

Path parameters

productstring required
Example:inference

Product the limit applies to, as returned in product by the list operation.

Query parameters

period'daily' | 'monthly'

daily is the current UTC day; monthly is the current UTC calendar month.

Example:daily

Limit period. Defaults to daily; send it explicitly.

credential_idstring
Example:KEY0192F3A1B2C3D4E5F6A7B8C9D0E1F2

Identifier of one API key as recorded on usage, never the key's secret, percent-encoded: the request is then about that key's limit. Absent means the total limit; present but blank is refused.

Request body

OR

Example request

{
  "amount": 100,
  "reason": "Raised for the product launch"
}

Response

The limit was updated. evaluation says whether the change lifted or started a block.

Example response

{
  "data": {
    "record_type": "spend_limit",
    "product": "inference",
    "product_name": "Inference",
    "period": "daily",
    "period_start": "2026-09-24",
    "period_end": "2026-09-25",
    "limit": {
      "amount": "100",
      "origin": "self_service",
      "updated_at": "2026-09-24T09:12:03.412Z"
    },
    "effective_limit_usd": "100",
    "spend_usd": "37.41",
    "block": {
      "detected_at": "2026-09-24T08:41:17Z",
      "spend_usd": "10.20",
      "limit_usd": "10",
      "blocked_until": "2026-09-25"
    },
    "allocation": {
      "total_limit_usd": "1000.00",
      "allocated_usd": "800.00",
      "unallocated_usd": "200.00",
      "over_allocated_usd": "0.00"
    },
    "credential_limits": [
      {
        "credential_id": "KEY0192F3A1B2C3D4E5F6A7B8C9D0E1F2",
        "limit": {
          "amount": "300.00",
          "origin": "self_service",
          "updated_at": "2026-10-20T08:03:40Z"
        },
        "spend_usd": "120.00",
        "block": {
          "detected_at": "2026-09-24T08:41:17Z",
          "spend_usd": "10.20",
          "limit_usd": "10",
          "blocked_until": "2026-09-25"
        }
      }
    ],
    "evaluation": {
      "spend_usd": "37.41",
      "note": "A block was lifted by Telnyx support today; this limit applies from tomorrow."
    }
  }
}

Changes

    • info

      added the new optional query request parameter credential_id

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      endpoint added