# Billing ## Get Status **get** `/api/promptly/billing/status` Retrieve current subscription and usage information ### Query Parameters - `organizationId: string` ### Returns - `billingPeriodStart: optional string` - `plan: optional "free" or "paid"` - `"free"` - `"paid"` - `runsLimit: optional number` Maximum runs allowed (null for unlimited) - `runsUsed: optional number` Task runs used this billing period - `stripeCustomerId: optional string` - `stripeSubscriptionId: optional string` - `tasksCount: optional number` Current number of active tasks - `tasksLimit: optional number` Maximum tasks allowed - `usageCostCents: optional number` Usage-based charges this period - `usageCreditsCents: optional number` Usage credits included in plan - `usersCount: optional number` - `usersLimit: optional number` ### Example ```http curl https://0ct.com/api/promptly/billing/status \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Create Checkout **post** `/api/promptly/billing/checkout` Create a Stripe checkout session for upgrading to paid plan ### Body Parameters - `organizationId: string` ### Returns - `url: optional string` Stripe checkout URL ### Example ```http curl https://0ct.com/api/promptly/billing/checkout \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{ "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }' ``` ## Create Portal **post** `/api/promptly/billing/portal` Create a Stripe billing portal session for managing subscription ### Body Parameters - `organizationId: string` ### Returns - `url: optional string` Stripe billing portal URL ### Example ```http curl https://0ct.com/api/promptly/billing/portal \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{ "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }' ```