POST
/v1/billing/credits/purchaseBuy a credit pack
Opens a Stripe checkout page for one AI credit pack and answers its checkoutUrl for a person to open. pack is a priceId from GET /v1/billing/catalog; anything that is not a live credit pack is refused. The credits land on the ledger when the payment clears, never when this call returns. Needs the workspace's owner or admin seat.
Access class: workspace:admin.
Send request
Use the documented inputs to call this endpoint directly.
API serverbase URL
Bearer tokensessionoptional
Stored only in this browser for the session security scheme and reused on every API page in this group.
Request body
application/jsonrequiredbodyoptional
paramsobjectoptional
queryobjectoptional
Responses
201application/json
the action's answer
{
"data": {
"checkoutUrl": "string"
}
}datarequired
defaultapplication/json
a refusal: {"error": "<what a person needs to read>"}. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.
{
"error": "string"
}errorstringrequired