Skip to content
Docs

List AI Gateway budgets

GEThttps://api.vercel.com/ai-gateway/budgets/list
List the team's AI Gateway budgets (team/project/user scopes, plus default-covered api-key spend) as a flat list, optionally filtered by scope.
https://api.vercel.com/ai-gateway/budgets/list
const response = await fetch('https://api.vercel.com/ai-gateway/budgets/list?scopeType=string&teamId=string&slug=string', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
Response
{
"budgets": [
{
"active": "false",
"alertThresholds": [],
"archived": "false",
"createdAt": "123",
"currentByokSpend": "123",
"currentSpend": "123",
"includeByokInQuota": "false",
"limitAmount": "123",
"name": "Example Name",
"quotaEntityId": "example_id",
"refreshPeriod": "daily",
"scopeId": "example_id",
"scopeType": "api-key",
"source": "default",
"updatedAt": "123"
}
]
}
AuthorizationbearerToken

Default authentication mechanism

scopeTypestringOptional
Restrict the list to a single budget scope.
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Success
budgetsarrayRequired
400One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error
500Error