Skip to content

Set the monthly token limit. No limit means no budget.

PUT
/admin/budget
curl --request PUT \
--url https://example.com/api/v1/admin/budget \
--header 'Content-Type: application/json' \
--data '{ "token_limit": 1 }'
Media typeapplication/json
object
token_limit

Leave it out for no limit.

integer format: int64
Examplegenerated
{
"token_limit": 1
}

The budget.

Media typeapplication/json
object
month
required

YYYY-MM, in UTC.

string
token_limit
integer format: int64
tokens_used
required
integer format: int64
Examplegenerated
{
"month": "example",
"token_limit": 1,
"tokens_used": 1
}

An error.

Media typeapplication/problem+json

RFC 9457 problem details with a stable code.

object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
code
required

A stable machine-readable error code.

string
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"code": "example"
}