Skip to content

Organizations

Last updated: 2026-11-25T18:37:43-03:00 (UTC-3)

An organization sits above teams: a business unit, a customer, a subsidiary. It defines a model ceiling that applies to every key of every one of its teams, and it lets you filter usage and cost by organization.

Every team belongs to exactly one organization. org_default exists from installation, cannot be deleted, and receives the teams that do not yet have another one.

features:
team_management: true
organizations: true # boot
organization_management: true # edit through the console and the API
organizations:
- id: platform-org # lowercase, no "_"
name: Platform
allowed_models: [chat-default]
teams: [platform]
Key What it does
organizations[].id Unique lower-case identifier, 2–64 characters of letters, digits and - (no _)
organizations[].name Display name, 1–80 characters without control characters
organizations[].allowed_models Up to 200 aliases or group:<id> references the organization’s keys may ever use; omit it for no ceiling
organizations[].teams The teams that belong to the organization; they are reassigned to it at every boot

organization_management lets global administrators create and rename organizations, set their model ceiling and move teams between them from the console and the API. Organizations declared in the YAML are read-only in the console and the API (409 organization_declared), and the teams listed in them cannot be moved through the console.

  • allowed_models accepts aliases and access groups (group:<id>). * is not accepted.
  • A ceiling entry may be a prefix/* alias (a model declared with a prefix/* ID, which serves any model under the prefix). A key keeps what both it and the ceiling allow, the narrower of the two: under a ceiling of groq/*, a key that names groq/llama keeps groq/llama, a key with * or groq/* keeps groq/*, and a key that names only models outside the prefix keeps none. Under a ceiling of groq/llama, a key with groq/* keeps groq/llama alone. The result is never wider than the ceiling.
  • Without allowed_models, there is no ceiling. An empty list blocks all models.
  • The ceiling applies on every request, after the key, the groups and the team policy. Removing a model from the ceiling, or moving the team to another organization, takes effect on the next call.
  • Only the global admin defines the ceiling.

A team keeps its ID, its keys and its configuration when a global administrator moves it to another organization. What it recorded stays where it was recorded: a request, its spend, its capture and spans, a session, a trace, an evaluation result, a comment and an experiment run belong to the organization they ran in, and nothing is rewritten by the move.

Spend stays with the former organization.

  • Every request is recorded with the organization its team was in when the request was admitted. That organization is read from the team on each request, never from a copy kept on the key: the first request after the move is recorded in, and charged to, the new organization.
  • The totals of Usage and Analytics, the daily rollups, the cost report (/valuation), the budget charge comparison, the request log and its export, and the organization dimension and filter of the usage query all count a request for the organization it ran in. An organization’s totals hold what was spent in it, by the teams it has now and by the teams that left; they never hold what a team spent before it arrived.
  • A request recorded with no organization (written with organizations off, or before the gateway recorded it) stays with its team and counts for the organization the team is in now.
Who reads ?team= names the moved team ?organization=
A team role of the team, and the administrators of its new organization What the team recorded since the move, and its rows that record no organization Its own organization only: what was recorded there
The former organization’s administrator What the team recorded in that organization, and nothing since Its own organization only: its teams’ rows and what the teams that left recorded there
The global administrator The team in its current organization, as its own roles see it The rows recorded in the organization named

Budgets.

  • An organization’s budget, TPM and TPD (the tenant subject) count what its teams spent while they were in it. The former organization’s window keeps what the team spent there and is not freed: a move cannot be used to empty an exceeded budget. The new organization’s window is not charged for the past and counts the team from the move on.
  • The team’s own budget, and those of its keys and users, do not look at the organization: they run across the move. A team at 90% of its monthly budget is still at 90% in its new organization.
  • A realtime session is admitted once: one that was open when the team moved keeps recording and charging the organization of its admission until it ends.

The former organization’s administrators keep reading what was recorded there. With organization admins, the administrator of the former organization reads everything the team recorded in that organization, and nothing it records after leaving:

  • What. Totals, rollup days, the cost report, the budget charge comparison and the request log (page and export); a request with its journey, trace and spans, and the trace explorer; captures and their content; evaluation results, their revision history and scores, the statistics of one score and the agreement of two, experiment runs, comment threads; agent runs with their steps; the usage query; durable receipts; the team’s and its keys’ detail and savings; the team’s alerts, also among the records of a trace.
  • How it is read. Through the organization recorded on each row, never through the team. Lists that are not narrowed to a team include it. To narrow to the team, name it: ?team=<team> on the usage, log, durable receipt, agent run and detail routes, team_id on evaluation results, experiment runs (/evals/runs), scores (/evals/scores), evaluation captures (/evals/captures), score analytics, agreement and comment threads, a team:<team> term in the trace explorer, a team filter in the usage query. A team that was never in the organization answers with nothing; a team the session may not name is refused (403 or 404), not answered empty.
  • Where each row belongs. Every row records the organization it was written in, when it is written: a request log row, a span, a score and an experiment run the organization the request or the run was admitted under; a content capture, an evaluation capture, a durable receipt, a quota reservation and an agent step the one of their request; a comment and a review queue item the team’s organization when it was written (or, for a global administrator writing about what the team recorded before it moved, the organization that recorded the target); a mention its comment’s. The decision never compares two clocks, so a request ID or a session the client sends again after the move cannot carry a row to the other side. Rows written before this rule (migration 270), and rows replicas of the earlier release write during a rolling upgrade, are placed once, in the background, by the rule the release before applied (the request log row nearest in time); until then, and for a row that cannot be placed that way, that rule still applies (see the upgrade notes below).
  • With the query language. The request log’s q, its facets and a saved view read the same rows as the list they narrow: the team the request names (?team=<team>, the form’s team in the console) or, with ?organization=, the whole organization, where team:<team> names the team that left. Evaluation, span and text terms are resolved under that same scope, so a term never matches a row the list could not show. A saved view keeps the query, not the team: it is applied over the team the screen has selected. On the routes that take ?organization=, the administrator’s own organization shows the team in the by-team ranking.
  • Which teams. GET /api/v1/admin/config lists them for the administrator as former_teams (id, the name the team had when it left, left_at), and the console’s team selector on Usage, Logs, Durable usage, Evals (the “Recorded by team” selector over experiments, scores and captures, and the team of score analytics and agreement) and Traces offers each as “ (left on )”. The team’s detail answers with status: left and left_at, the usage it recorded there, and none of its configuration or its keys’ (that is another organization’s now). A key’s detail and savings are read the same way when the key served requests recorded in the organization; a key the team got after it left answers 404.
  • With which permissions. The ones the administrator already holds, under its custom role ceiling if it has one: analytics:read, logs:read, evals:read, and for captured content the same content permissions it has over its own teams (structure, sent view, reasoning, media, received view). No new permission exists for this, and it is a read: the administrator cannot score, comment on, queue or replay what the team recorded, and cannot act on its alerts.
  • With feature plans. Rows belong to the organization they were recorded in, so that organization’s own plan, as it is now, governs these reads (organization_plan_entitlements): the route’s features must be in it. Without such a plan, with a disabled one, or with organization plans off, the path is closed and the administrator reads only its teams of now, each under its own plan. A team that is in the organization now is never opened by the organization’s plan: left out by its own plan, it stays out. The organization is read whole (?organization=) only when, in addition, none of its teams of now is left out of the route by the team’s plan. When one is, the plan of a team that stays does not close the path to a team that left: the lists still hold what each team that left recorded there (the teams of former_teams, at most 500), and such a team is still read by naming it. The same holds for a feature inside a route: a team of now without evaluation_results keeps its results out of every list, facet and query term, also through the organization, while the results a team that left recorded there stay.
  • What follows the team instead. Its configuration: datasets, evaluators, score configs, rules, queues, prompts, keys and policies move with it and are not the former organization’s any more. See targets after a team moves for the team’s own side.

Alerts. A team’s alert rule scans what the team recorded in the organization it is in now; an organization’s rule scans what was recorded in that organization. An alert of a team belongs to the organization the team was in when it last fired: the team’s alert list shows the alerts raised in its current organization, and the former organization’s administrators keep the ones raised there (to read, not to acknowledge or resolve). The query of a scheduled rule counts the rows of the rule’s scope, and its evaluation and span terms are resolved under it: an organization’s rule counts what a team that left recorded there, a team’s rule what the team records in its organization of now. The counters of a live evaluation rule (pending, done, failed) and its job list count the requests of the team’s current organization.

Audit. A move writes three events with the same request ID, from the console and the API (actor: the administrator) and from a YAML declaration that takes a team from another organization (actor system:config):

Action Target Shown to
team.organization the team The new organization’s administrators and the global audit view
team.organization_leave the team The former organization’s administrators and the global audit view
team.organization_move <team>/<former organization>/<new organization> The global audit view only, so neither organization learns the other’s ID

Upgrade (migrations 213, 214, 235 to 238 and 270). All run at start and read no request log row.

  • Rollups (213). The organization joins the rollup key. Every day built before is taken out of use and queued; the gateway rebuilds the queue in the background, newest day first, at most 31 days every five minutes and each day in its own transaction, so a restart loses nothing. Until a day is rebuilt, reports answer it from the request log (correct, and as slow as without analytics_rollup_reads), and GET /api/v1/admin/analytics/rollups lists it under missing_days. A day costs one aggregate over that day’s request log rows, what the periodic build already pays for today and yesterday: measured on one machine (PostgreSQL 16 in a local container), 30 days of 100,000 requests each were rebuilt in 16 s (0.55 s a day), and 30 days of 20,000 requests each in under 2 s. A run has four minutes; a day that needs longer stays queued and keeps being answered from the request log. The log line rollup_organization_rebuild reports the days done and left. The migration also rebuilds the table’s primary key under a lock: measured, 1.1 s for 1.2 million rollup rows and 4.8 s for 5 million.
  • Usage copy (214). With an analytics store, the copied request log carries the organization too. Rows copied by the earlier release that record an organization are copied again once, in batches of analytics_store.copy.batch_size; a deployment that never had organizations on has none. Until that ends, Usage, the request log and alert scans read PostgreSQL, and GET /api/v1/admin/analytics-store shows state: copying with copy.organization_backfill_pending: true. Measured on the same machine against ClickHouse 25.12, 600,000 such rows were copied again in 29 s and 2.4 million in 2 min 13 s (18,000 to 21,000 rows a second, against 125,000 to 147,000 a second for a first copy: each batch is deleted and written again).
  • A very large day (235, 238). A day whose rebuild does not finish in one statement within a minute is rebuilt in slices: each slice is aggregated in its own transaction into a staging table, progress is kept between runs and across restarts (a cursor into the day), and the day’s rollup rows and its marker are replaced together when the last slice is done, so no report ever reads half a day. Slices start one hour wide; a slice that does not aggregate within a minute is halved, down to one second, and the width that worked is remembered for the day. A day known to need slices is no longer tried whole at every build: the periodic build and POST /api/v1/admin/analytics/rollups/rebuild queue it at once, and the background rebuild, which alternates between today and yesterday and the older days, stages it. A day whose build fails is left out for that run and the others go on. The manual rebuild answers 202 with {"queued": true, "from", "to", "days"} when days were left to the background rebuild (a range that did not fit its two minutes, or a day built in slices) and 204 when the range was built; a day asked for while its slices are being staged runs once more after that pass, so events written during it are counted. The log line rollup_organization_rebuild reports staged_slices, and rollup_build_queued a periodic build that ran out of its time. Measured on one machine: a day of 240,000 requests took 0.5 s as one statement, 1.0 s in 24 hour slices and 3.3 s in 96 quarter-hour slices. What remains unbounded is one second of requests that does not aggregate within a minute; the rebuild then reports that second and the day stays answered from the request log.
  • Alerts (236) and teams that left (237). gateway_alerts gains the organization an alert was raised in; earlier alerts have none and stay with their team. gateway_team_departures records each team that leaves an organization, with its name and the time. Moves made before the upgrade are rebuilt from the audit log (a team’s creation and each of its moves), as far as audit retention kept those events; a team whose earlier move is no longer in the audit log is not listed in former_teams, and its rows are still read through the organization by naming it.
  • The organization on every row (270). Comments, review queue items, content and evaluation captures, durable receipts, quota reservations and agent steps gain organization_id and organization_unplaced; the migration only adds the columns (no table scan). With organizations on, the retention worker then places, every minute and in short transactions that never hold a table, the rows that record none, by the rule the earlier release applied (the request log row nearest in time). First the page sweep of what existed at the upgrade, up to 8 MB of a table per transaction (a step that takes longer than 4 seconds, or meets a locked row, is undone and the next one reads half as much). Once it is done, an index sweep, for good, of every row still to try: rows that were too recent or pending at the page sweep, old rows moved to a page it had already read, and what replicas of the earlier release keep writing during a rolling upgrade. A row is tried once it is six hours old (the window the rule looks in), and placed or marked unplaceable, so none is tried twice. Until a row is placed, and for good when it is marked, its readers apply the earlier rule. Progress: gateway_recorded_organization_backfill (pages read, rows placed and marked); the log lines recorded_organization_backfill and recorded_organization_backfill_failed (with its stage). The index sweep’s partial indexes (*_organization_pending) are built CONCURRENTLY by one replica after the page sweep.
  • Rolling upgrade. A replica still on the earlier release cannot build a rollup day or copy to the analytics store any more: it logs rollup_build_failed and analytics_copy_failed, and its copy status view answers 503, until it is replaced. The upgraded replicas do that work meanwhile. A replica of a release between 235 and 238 does not know the slice cursor either: its queue writes fail, and a day it builds whole takes that day out of the queue, so a day built in slices may start over while both releases run. Finish the rollout before relying on any of it.
Action API Console
List GET /api/v1/admin/organizations (admin, viewer) Organizations
Create, rename, set the ceiling POST, PUT /api/v1/admin/organizations/{id}, with version Organization form
Delete DELETE …/{id}; refused with active teams, for org_default and for organizations from the YAML Delete
Move a team PUT /api/v1/admin/teams/{id}/organization, with the team’s version; refused (409 team_has_organization_members) while a member belongs to the current organization Selector on the team
Route JIT users jit_email_domains on create or update (with organization_admins), or in YAML JIT e-mail domains in the organization form
Create a team in an organization POST /api/v1/admin/teams with organization_id —
Filter usage ?organization= in logs, log export, analytics and valuation —

The organization filter selects what was recorded in that organization (when a team moves). It does not combine with team for a global administrator and does not widen what a team session can see; an organization administrator may name its own organization, alone or with team. Every change goes into the audit.

A budget, TPM or TPD for every key of an organization’s teams uses the tenant subject of the quota policies with the organization ID, and a request rate the tenant subject of the rate policies. Both are ceilings the global administrator sets; an organization admin reads them. The older organization quota subject is a financial account a key is attributed to, not this tenant.

With organization_admins, an organization may list jit_email_domains (up to 50 lowercase domains, YAML or API). A new JIT user whose verified e-mail has one of those domains joins that organization, so its organization admin approves or rejects it; a domain listed by no organization, or by more than one, leaves the user gateway-wide for the global administrator. Omitting jit_email_domains on update keeps the stored list.

organizations:
- id: acme
name: Acme
jit_email_domains: [acme.example]
  • With organization_admins (T168), the org_admin role administers one organization’s teams, team-scoped users, keys and audit view; see organization admins. There is no per-organization viewer role, and ceilings stay with the global admin.

Every route below needs a console session or an admin Bearer token, the role’s permission and, for writes, the X-CSRF-Token header; the full contract is in the API reference.

Route What it does
PUT /api/v1/admin/organizations/{id}/model-aliases/{alias} Creates or replaces a console model alias of the organization
DELETE /api/v1/admin/organizations/{id}/model-aliases/{alias} Deletes a console alias at its current version
POST /api/v1/admin/organizations Creates a console organization; omit allowed_models for no ceiling
DELETE /api/v1/admin/organizations/{id} Deletes an organization with no active teams; YAML organizations and org_default are refused

Organization display names follow the existing one-to-eighty Unicode code-point (Go rune) limit. The console preserves valid astral characters; the server remains authoritative for the boundary and reference checks. Shared parameter definitions do not generate an organization identity or grant its models. A missing model ceiling and an explicit empty allowlist retain their distinct semantics; team ownership and every additional authorization ceiling remain in force.

Section titled “Concurrent team links and organization deletion”

Creating or moving a team locks its active target organization through the transaction, so a concurrent logical deletion cannot leave the team attached after the target disappears. A refused link preserves the prior tenant, version and audit state. If stored team authority already references an inactive organization, inference fails closed with organization_unavailable; it does not become unrestricted. A global administrator can use the existing versioned team-organization selector to move the team to an active organization. An unknown declarative bootstrap team still resolves through org_default.

Organizations can optionally receive a feature-plan ceiling under organization_plan_entitlements, separate from their model ceiling. It intersects the team plan and never grants scopes, membership or model access; no assignment preserves team-only entitlement behavior. Assignments use the active organization ID and live team ownership. Manage source/version/revert in Plans & entitlements; see plan enforcement and upgrade.

Removing a restrictive organization assignment restores an unrestricted layer and can grant rights. In a classified edition, that transition is checked for new licensed grants, including YAML removals and runtime boundary deactivation. It is not treated as an empty grant. Existing admitted operations and the instance security controls remain independent.

m7gtw[email protected]