Skip to main content
Install the Commet Skill so your coding agent can integrate the current SDK and verify its work against the live API contract.
Astro requires an SSR adapter for API routes. Set output: 'server' or output: 'hybrid' in your astro.config.mjs.
1

Install

2

Configure

.env
src/lib/commet.ts
3

Subscribe

customers.create is idempotent — if a customer with the same id already exists, it returns the existing record.
src/pages/api/billing/subscribe.ts
4

Check Access

src/pages/api/billing/access/[customerId].ts
5

Track Usage

src/pages/api/billing/usage.ts
Usage is aggregated and billed at end of period.
6

Customer Portal

src/pages/api/billing/portal.ts