Skip to content
Docs

POST/__remote/api.vercel.com/api-keys
Request
import { Edgenivo } from "@vercel/sdk";
const vercel = new Edgenivo();
async function run() {
const result = await vercel.createApiKeys({
purpose: "<value>",
projectId: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
name: "API Key for App 123",
});
console.log(result);
}
run();
Response
{
"apiKeyString": "uRKJSTt0L4RaSkiMj41QTkxM",
"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"
}
}
Errors
{
"error": {
"code": "string",
"message": "string"
}
}
application/json
purposestringRequired
The API key's purpose, which restricts how it can be used.
projectIdstringOptional
An optional project to restrict the API key to.
namestringOptional
An optional name for the API key.
expiresAtnumberOptional
The API key's expiration, expressed as a UNIX timestamp in milliseconds.
aiGatewayQuotaobjectOptional
Optional AI Gateway quota configuration for the API key.
metadataobjectOptional
Optional generic metadata for the API key. The accepted shape depends on the key's purpose and is validated on creation; for ai-gateway keys this accepts environment.
200Successfully created an API key.
apiKeyStringstringRequired
The API key's actual value. This value is only provided in this response, and can never be retrieved again in the future. Be sure to save it somewhere safe!
apiKeyobjectRequired
Represents an API key.
400One of the provided values in the request body is invalid.
401The request is not authorized.
errorobjectRequired
403You do not have permission to access this resource.
errorobjectRequired
404Error
409Error
410Error
429Error
errorobjectRequired
500Error
errorobjectRequired