Set the monthly token limit of one queue. 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: '{"queue":"interactive","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 '{ "queue": "interactive", "token_limit": 1 }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
queue
The queue whose limit this sets. Default interactive.
string
token_limit
Leave it out for no limit.
integer format: int64
Responses
Section titled “ Responses ”The budget.
Media typeapplication/json
object
month
required
YYYY-MM, in UTC.
string
token_limit
The interactive queue’s limit.
integer format: int64
tokens_used
required
The interactive queue’s use.
integer format: int64
queues
required
The limit and use of each queue (docs/specs/hosted-operations.md).
Array<object>
object
queue
required
string
token_limit
integer format: int64
tokens_used
required
integer format: int64
spend
required
This month’s spend by queue, person and repo, largest first.
Array<object>
object
queue
required
string
actor
required
The user ID of the person, or “app” for the GitHub App.
string
actor_name
string
repo
required
The GitHub repo as owner/name, or empty when the work named none.
string
tokens
required
integer format: int64
cost_usd
required
number format: double
Example
{ "queues": [ { "queue": "interactive" } ], "spend": [ { "queue": "interactive" } ]}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"}