Upsert AI Gateway budget
PUT
https://api.vercel.com/ai-gateway/budgetsCreate or update a team-, project-, or user-scope AI Gateway budget.
https://api.vercel.com/ai-gateway/budgets
const response = await fetch('https://api.vercel.com/ai-gateway/budgets?teamId=string&slug=string', { method: 'PUT', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "scopeType": "team", "projectId": "example_id", "userId": "example_id", "limitAmount": "123", "refreshPeriod": "daily", "includeByokInQuota": "true", "alertThresholds": [] }),});
const data = await response.json();console.log(data);Response
{ "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
application/json
200Success
The native Vercel id of the scoped entity. Team/project ids already carry their prefix, so this equals
quotaEntityId (team_… / prj_…); for the api-key scope it is the api key id (the api_key_id_ prefix stripped).400One of the provided values in the request body is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error
500Error