Authentication
API keys and request security
llms.txtAPI keys and request security
API keys
- Prefix:
kwit_live_ - Sent as
Authorization: Bearer <full_key> - Scoped to one organization; all created resources belong to that org
- Keys can expire; expired keys return
401
Resolution flow
- Extract bearer token from
Authorizationheader - Hash and lookup in
ApiKeytable - Reject if missing, unknown, or expired
- Attach
organizationIdto the request context for all downstream services
Audit
Failed auth attempts are audit-logged (api_key.invalid). Successful requests log resource types per route (e.g. api_key.request.customers.create).
SDK
import Kwit from "@kwit/sdk";
const kwit = new Kwit({
apiKey: process.env.KWIT_API_KEY!,
maxRetries: 3,
timeout: 15_000,
});Never expose live keys in browser code - call Kwit only from your backend.