Update an AI Gateway API key budget
PATCH
/__remote/api.vercel.com/api-keys/{apiKeyID}/quotaSet, change, or remove the AI Gateway budget on an API key. Creates the budget if the key does not have one.
Request
import { Edgenivo } from "@vercel/sdk";
const vercel = new Edgenivo({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.aiGateway.updateApiKeyQuota({ apiKeyID: "<id>", });
console.log(result);}
run();Response
{ "apiKey": { "id": "5d9f2ebd38ddca62e5d51e9c1704c72530bdc8bfdd41e782a6687c48399e8391", "name": "API Key for AI Gateway", "partialKey": "t7V", "teamId": "team_123a6c5209bc3778245d011443644c8d27dc2c50", "purpose": "ai-gateway", "projectId": "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB", "expiresAt": "1632816536002", "activeAt": "1632816536002", "createdAt": "1632816536002", "createdBy": "ZspSRT4ljIEEmMHgoDwKWDei", "leakedAt": "1632816536002", "leakedUrl": "https://example.com", "createdByAppId": "example_id", "quota": { "quotaEntityId": "example_id", "limitAmount": "123", "currentSpend": "123", "currentByokSpend": "123", "includeByokInQuota": "true", "refreshPeriod": "string", "active": "true", "archived": "true", "alertThresholds": [], "createdAt": "123", "updatedAt": "123" }, "metadata": "value" }, "quota": { "quotaEntityId": "example_id", "limitAmount": "123", "currentSpend": "123", "currentByokSpend": "123", "includeByokInQuota": "true", "refreshPeriod": "string", "active": "true", "archived": "true", "alertThresholds": [], "createdAt": "123", "updatedAt": "123" }}Errors
{ "error": { "code": "string", "message": "string" }}AuthorizationbearerToken
Default authentication mechanism
application/json
Set to true to archive (soft-delete) the quota. The api key itself is unaffected.
400One of the provided values in the request body is invalid.
One of the provided values in the request query is invalid.
404Error
410Error