Organizations
ai& is multi-tenant by design. Every request runs in the context of an organization, and all billing, API keys, rate limits, and request history are scoped to that org.
The data model
Section titled “The data model”- User — an individual account, identified by email. Created on first OAuth or magic-link sign-in.
- Organization — a billing and access boundary. Owns credits, API keys, files, request logs.
- Membership — connects a user to an organization with a role (
owner,admin,member). A user can belong to multiple orgs. - API Key — issued at the org level. Carries the org context automatically; no
X-Org-IDneeded when authing with an API key. - Billing Account — one per org. Holds credit balance, payment methods, invoice history.
Picking the right org
Section titled “Picking the right org”- API key auth — the key already encodes the org; everything happens in that org.
- JWT (browser) auth — pass
X-Org-IDon each request to select the active org. See Switching Orgs.
Per-org scoping
Section titled “Per-org scoping”Each of these is independent across organizations:
- Credit balance and payment methods
- API keys
- Uploaded files
- Request logs and analytics
- Rate-limit buckets (see Rate Limits)