API v1 overview
Base URL, authentication, and endpoint map
llms.txtBase URL, authentication, and endpoint map
Base URL
https://api.kwit.dev/v1All paths below are relative to /v1.
Authentication
Every request requires:
Authorization: Bearer kwit_live_<your_key>Keys are created in the dashboard (Developers → API Keys). Invalid or expired keys return 401 with { "error": "Invalid or expired API key" }.
Use the @kwit/sdk for typed requests, retries on 429/5xx, and webhook verification.
Endpoint map
| Resource | Methods |
|---|---|
| Customers | POST /customers, GET /customers/:id/state, POST /customers/:id/meter-credits |
| Checkout | POST /checkout, GET /checkout/:sessionId |
| Portal | POST /portal/sessions |
| Products | POST /products, GET /products, GET /products/:id, PATCH /products/:id/meter-prices |
| Discounts | POST /discounts, GET /discounts/:id, POST /discounts/validate |
| Subscriptions | POST /subscriptions, GET /subscriptions/:id, POST /subscriptions/:id/cancel |
| Checkout links | POST /checkout-links, GET /checkout-links/:id |
| Usage billing | POST /events/ingest, GET /events, POST /meters, GET /meters, PATCH /meters/:id, DELETE /meters/:id |
Validation errors
400 responses return Zod field errors:
{
"error": {
"email": ["Invalid email"]
}
}See Errors.