Purchase credits
https://api.vercel.com/v1/billing/buyv0, gateway, and agent. The amount field specifies the number of credits to purchase and must be a positive integer. An optional source query parameter can be provided to identify the caller. Defaults to api if not specified. This is only available for Owner, Member, Developer, Security, and Billing roles for the supplied team.const response = await fetch('https://api.vercel.com/v1/billing/buy?source=string&teamId=string&slug=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "item": { "type": "credits", "creditType": "v0", "amount": "123" } }),});
const data = await response.json();console.log(data);{ "checkoutSessionId": "example_id", "checkoutSessionUrl": "https://example.com"}Default authentication mechanism
api if not specified.