Read the workspace AI auto-refill settings
Returns the workspace's opt-in auto-refill preference and its monthly ceiling. Requires a Clerk session and the `billing:read` workspace permission.
Authorization
apiKey Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
In: header
Path Parameters
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/v1/workspaces/string/billing/ai-topups/settings"{ "data": { "autoRefillEnabled": true, "autoRefillMonthlyCeilingMicrousd": 0 }}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}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.
Update the workspace AI auto-refill settings
Updates whether auto-refill is enabled and its monthly spend ceiling, recording the acting user; omitted fields are left unchanged. Requires a Clerk session and the `billing:manage` workspace permission.