Skip to navigation

Retrieve a spend limit

Returns the limit and what has been spent against it so far this period.

Authentication

AuthorizationBearer

A secret key (rl_sk_test_..., rl_sk_live_...) or a restricted key with limited scopes (rl_rk_test_..., rl_rk_live_...). A restricted key can carry agent: true and an expires_at, and is what a coding agent should hold. Keys end in a checksum so secret scanners can recognize them. People create, roll and revoke keys in the dashboard; GET /v1/api_keys lists them, masked.

Path parameters

spend_limit_idstringRequired

The spend limit ID (sl_...).

Response

The spend limit.
idstring
object"spend_limit"
applies_toobject

Every condition you send must match, and a limit with none applies to the whole account. Limits are grouped by which of agent_id, member_id, team_id and pool they name. Inside a group the most specific one applies to a customer: its own customer, then its plan, then the account. Every group that applies must have room, so the strictest group decides.

periodobject
amountobject
An amount of money in the currency's minor unit.
countsenumDefaults to paid_usage

What counts toward the limit. paid_usage: the money value of consumption drawn from paid credits and overage, so included and promotional usage keeps working. all_usage: the money value of everything. Buying credits never counts.

Allowed values:
actionenumDefaults to warn

warn adds warnings and a webhook. block also denies in check().

Allowed values:
set_byenumDefaults to operator

operator: you set it as policy. customer: your customer chose it, through your product or the customer view.

Allowed values:
enabledboolean
livemodeboolean
created_atdatetime
keystringOptional
ceilingobjectOptional
An amount of money in the currency's minor unit.
alert_atlist of stringsOptional
currentobjectOptional

What has been spent against the limit this period. Read-only.

actorobjectOptional
Who last changed the limit.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error