SnozeDevelopers
API referenceBilling

Open a hosted checkout session for an AI top-up pack

Creates a Polar checkout session for a prepaid AI top-up pack; the balance is credited later by the order webhook, not by this call. Requires a Clerk session with a synced profile and the `billing:manage` workspace permission, and is refused as forbidden when the workspace's usage snapshot reports that top-ups are not available on its current plan.

POST
/v1/workspaces/{workspaceId}/billing/ai-topups/checkout
AuthorizationBearer <token>

Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.

In: header

Path Parameters

workspaceId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/workspaces/string/billing/ai-topups/checkout" \  -H "Content-Type: application/json" \  -d '{    "pack": "small"  }'
{  "data": {    "id": "string",    "url": "string"  }}