The hierarchy
Organization
Organization
The top-level account for billing, members, roles, and environments. Organization administration normally uses an authenticated user session.
Environment
Environment
An isolated deployment context such as development, staging, or production. Every API key belongs to exactly one environment and cannot reach another one.
Tenant
Tenant
The resource owner for a customer or project. A tenant has its own credit pool, quotas, knowledge bases, and data. In a multi-customer product, create one tenant per customer.
Knowledge base
Knowledge base
The retrieval boundary for documents, connected data, agents, and chats. Documents are indexed in a private partition for that knowledge base.
How API keys narrow access
An API key always belongs to one environment. Its optional resource lists determine what it can reach inside that environment:The multi-customer pattern
Use two levels of isolation in a customer-facing application:- Create one tenant per customer account to separate data, credits, and quotas.
- Pass a stable
external_subject_idper end user to separate chat ownership and durable memory inside that tenant.
acme to one tenant, then use the application’s own stable user IDs as external subjects:
1
Create a tenant for the customer
2
Create a chat for an end user
3
Keep passing the same subject
Include
external_subject_id=user_1042 whenever you list, read, update, or continue that API-key-owned chat. A chat created for one external subject cannot be accessed as another subject.Next steps
Access & scopes
Give each API key only the permissions and resources it needs.
Tenant API
Create tenants and configure their quotas and memory settings.