Set the monthly token limit. No limit means no budget.
PUT
/admin/budget
const url = 'https://example.com/api/v1/admin/budget';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"token_limit":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/api/v1/admin/budget \ --header 'Content-Type: application/json' \ --data '{ "token_limit": 1 }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
token_limit
Leave it out for no limit.
integer format: int64
Examplegenerated
{ "token_limit": 1}Responses
Section titled “ Responses ”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}default
Section titled “default”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"}