APIAPI reference
Set or remove a scoped spending policy
PUT /v1/limits
PUT /v1/limits
Owners and admins with limits:manage only. Null means no cap; all null removes the policy. monthly_calls=0 blocks matching calls. A zero money cap blocks paid calls. Monthly periods use UTC.
Authorization
This operation requires a bearer credential. The description defines additional role, scope or first-party-session restrictions; an API key does not grant those permissions by itself.
Request body
| Property | Type | Required | Details |
|---|---|---|---|
scope | "workspace" ∣ "member" ∣ "key" ∣ "client" | yes | |
subject_id | string | yes | Empty for workspace; otherwise user ID, key ID or OAuth client ID. |
monthly_calls | integer ∣ null | yes | |
monthly_budget_microusd | integer ∣ null | yes | |
max_call_microusd | integer ∣ null | yes |
Full schema: SpendLimit
{
"properties": {
"scope": {
"type": "string",
"enum": [
"workspace",
"member",
"key",
"client"
],
"title": "Scope"
},
"subject_id": {
"type": "string",
"title": "Subject Id",
"description": "Empty for workspace; otherwise user ID, key ID or OAuth client ID."
},
"monthly_calls": {
"anyOf": [
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Monthly Calls"
},
"monthly_budget_microusd": {
"anyOf": [
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Monthly Budget Microusd"
},
"max_call_microusd": {
"anyOf": [
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
{
"type": "null"
}
],
"title": "Max Call Microusd"
}
},
"type": "object",
"required": [
"scope",
"subject_id",
"monthly_calls",
"monthly_budget_microusd",
"max_call_microusd"
],
"title": "SpendLimit"
}Responses
| HTTP | Details | Type |
|---|---|---|
| 200 | Successful Response | application/json: SpendLimitList |
| 401 | Unauthorized | application/problem+json: ProblemDetails |
| 403 | Forbidden | application/problem+json: ProblemDetails |
| 404 | Not Found | application/problem+json: ProblemDetails |
| 422 | Unprocessable Entity | application/problem+json: ProblemDetails |
Response: SpendLimitList
| Property | Type | Required | Details |
|---|---|---|---|
items | SpendLimit[] | yes | |
currency | string | yes | |
microusd_per_usd | integer | yes |
Full schema
{
"properties": {
"items": {
"items": {
"$ref": "#/components/schemas/SpendLimit"
},
"type": "array",
"title": "Items"
},
"currency": {
"type": "string",
"const": "USD",
"title": "Currency"
},
"microusd_per_usd": {
"type": "integer",
"const": 1000000,
"title": "Microusd Per Usd"
}
},
"type": "object",
"required": [
"items",
"currency",
"microusd_per_usd"
],
"title": "SpendLimitList"
}This page is generated from OpenAPI; examples are schemas, not a fabricated successful response.