Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Send exactly one of amount and unlimited: true.

product
string
required

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

Example:

"inference"

amount
number
required

Limit in USD. 0 blocks at the first cent of spend.

Required range: x >= 0
Example:

100

period
enum<string>
default:daily

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

Available options:
daily,
monthly
Example:

"daily"

credential_id
string | null

Optional. Identifier of one API key as recorded on usage, never the key's secret: the limit then applies to that key only. Absent or null sets the total limit. A blank value, or one with control characters, is refused; it never means the total limit. An API key limit always has an amount.

Required string length: 1 - 255
Example:

"KEY0192F3A1B2C3D4E5F6A7B8C9D0E1F2"

unlimited
enum<boolean>

Optional; only false is allowed together with amount.

Available options:
false
Example:

false

reason
string

Why the limit is set or changed, kept for audit.

Maximum string length: 500
Example:

"Team budget"

Response

The limit was created. evaluation says whether the change blocked the product.

data
object
required

The spend limit, spend and block state of one product and period. The top-level fields describe the total limit of the account; API key limits are nested in credential_limits.