> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.panicly.lol/llms.txt.
> For full documentation content, see https://docs.panicly.lol/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.panicly.lol/_mcp/server.

# Data model

The canonical schema file is `packages/db/src/schema.sql`. Migrations exist under both `packages/db/migrations` and `packages/db/supabase/migrations`.

`organizations`, `users`, and `projects` store workspace identity, membership, plan state, onboarding state, and project thresholds.

`api_keys` stores project key prefix and hash. `provider_keys` stores encrypted upstream credentials and currently has one provider row per project.

`request_logs` stores request metadata, decision, internal reason, route, provider, model, geo fields, tokens, cost estimate, and timestamp.

`ip_rules`, `geo_rules`, and `model_rules` back network, region, and model controls.

`workspace_audit_events` and `credit_purchases` support audit history and purchased capacity.

## Important fields

Workspace plan tier. `plus` is the internal key for public Pro.

Credit-backed capacity balance used by runtime quota logic.

Internal storage field for public Sentry Mode.

Encrypted upstream provider credential decrypted during forwarding.

Region values are Panicly-defined buckets, not arbitrary map polygons.

Research notes found `workspace_audit_events` in SQL while the typed `Database` interface did not fully cover it. Verify type coverage before generating typed DB docs.