Skip to content

Multi-tenancy

Definition

A tenant is the top-level account — typically one organisation. A gateway is a named policy domain inside a tenant, for example production or staging. Each gateway has its own configuration, provider keys, authentication tokens, rate limits and routing rules.

One deployment serves many tenants and gateways, with hard isolation between them.

Object hierarchy

graph TD
    T["Tenant<br/>wallet · plan · settings"]
    T --> G["Gateway<br/>config · provider keys<br/>auth tokens · routing rules"]
    T --> D["Department<br/>allowed gateways"]
    T --> U["User<br/>role · optional department"]
  • Users belong to one tenant. A user's role decides what the user may do in that tenant.
  • Departments are an optional level below the tenant. A department decides which gateways its members may use. See Departments. Users, groups, departments, roles and sign-in are managed in the People section of the organisation's sidebar (Organisation › People); the organisation is part of the address (/org/<organisation>/people/...), so there is no organisation picker on those pages.
  • Feature toggles — whole product areas (for example agents, workflows and scheduled tasks) are switched on or off per tenant. A disabled area stays visible in the left rail with a Premium badge, and its routes are refused. Every new tenant starts with Agents, Playground, Scheduled tasks and Workflows off. See Feature availability.

Tenants list

URL routing

Every inference request names the tenant and the gateway in the URL path:

POST /v1/{tenant_slug}/{gateway_slug}/{provider}/chat/completions
POST /v1/{tenant_slug}/{gateway_slug}/compat/chat/completions

The gateway resolves both slugs on every request. An unknown slug returns 404 tenant_not_found.

Isolation mechanisms

Boundary Mechanism
URL routing The tenant and gateway prefix is resolved on every request.
Storage and internal state All data and state are scoped to the owning tenant and gateway.
Provider keys Encrypted at rest; decrypted only for the matching gateway.
Authentication tokens Scoped to one gateway; a token for gateway A is rejected on gateway B.
Rate limits, budgets, cache Tracked per gateway; never shared across tenants or gateways.

Roles

A role is a named set of permissions. Myra provides built-in system roles (for example administrator, tenant administrator, member and viewer); a tenant can also define custom roles. A role controls administration rights and whether the user may send inference requests. A role never widens which gateway a token reaches.

Deleting a user immediately disables that user's tokens.

See also