# API schemas: C

## CacheBackendEnvelope

Type: object

Existing privileged versioned backend editor response; connection fields retain their existing authorization. effective is what this replica serves, base the YAML cache_backend block, process the last apply on this replica. The optional settings extension is the same safe global projection.

- `version` (integer (int64), required)
- `source` (string, required, one of `"yaml"`, `"console"`)
- `effective` ([CacheBackendView](/docs/api/schemas/c/#cachebackendview), required)
- `base` ([CacheBackendView](/docs/api/schemas/c/#cachebackendview), required)
- `process` (object, required)
  - `source` (string, required)
  - `backend` (string, required)
  - `state` (string, required, one of `"applied"`, `"pending_retry"`, `"invalid"`)
  - `fingerprint` (string, required)
  - `applied_at` (string (date-time))
  - `last_error` (string)
  - `last_failed_at` (string (date-time))
- `note` (string, required)
- `settings` ([CacheSettingsSummary](/docs/api/schemas/c/#cachesettingssummary))

## CacheBackendView

Type: object

One cache backend connection without secret material (T179 names its fields by function). endpoint keeps only the scheme, host and port of the redis backend URL (no userinfo or path); url_configured says whether a URL is stored. tls_ca_pem appears only for a console-managed backend.

- `backend` (string, required, one of `"memory"`, `"redis"`, `"memcached"`)
- `namespace` (string)
- `addresses` (array of string)
- `timeout` (string, required)
- `max_entries` (integer, required)
- `max_bytes` (integer, required)
- `max_response_bytes` (integer, required)
- `max_concurrency` (integer, required)
- `allow_insecure` (boolean, required)
- `tls_enabled` (boolean, required)
- `tls_server_name` (string)
- `tls_ca_configured` (boolean, required)
- `tls_ca_pem` (string)
- `client_certificate_configured` (boolean, required)
- `endpoint` (string) — scheme://host:port of the redis backend URL; was redis_endpoint before T179
- `url_configured` (boolean, required) — Whether a redis backend URL is stored; was redis_url_configured before T179

## CacheConfiguredSettings

Type: object

- `backend` (string or null, required, one of `"memory"`, `"redis"`, `"memcached"`, `null`)
- `settings` (array of [CachePolicySetting](/docs/api/schemas/c/#cachepolicysetting), required, min items 5, max items 5)

## CacheManagedDurationParameterDefinition

Type: object or object or object

- One of (1): object
  - `key` (`"cache_backend.timeout"`, required)
  - `group` (`"cache"`, required)
  - `kind` (`"managed_duration"`, required)
  - `default` (`"250ms"`, required)
  - `minimum` (`"10ms"`, required)
  - `maximum` (`"2s"`, required)
  - `presence` (`"default"`, required)
  - `inherit_from` (null, required)
  - `creation_preset` (null, required)
  - `maximum_text_length` (null, required)
  - `minimum_from` (null, required)
  - `sources` (array of string, required, min items 3, max items 3)
  - `restart_required` (`false`, required)
  - `yaml_requires_restart` (`true`, required)
- One of (2): object
  - `key` (`"models[].cache.ttl"`, required)
  - `group` (`"cache"`, required)
  - `kind` (`"managed_duration"`, required)
  - `default` (null, required)
  - `minimum` (`"1s"`, required)
  - `maximum` (`"5m"`, required)
  - `presence` (`"required"`, required)
  - `inherit_from` (null, required)
  - `creation_preset` (`"30s"`, required)
  - `maximum_text_length` (null, required)
  - `minimum_from` (null, required)
  - `sources` (array of string, required, min items 2, max items 2)
  - `restart_required` (`false`, required)
  - `yaml_requires_restart` (`true`, required)
- One of (3): object
  - `key` (`"models[].semantic_cache.ttl"`, required)
  - `group` (`"cache"`, required)
  - `kind` (`"managed_duration"`, required)
  - `default` (null, required)
  - `minimum` (`"1s"`, required)
  - `maximum` (`"24h0m"`, required)
  - `presence` (`"required"`, required)
  - `inherit_from` (null, required)
  - `creation_preset` (`"1h"`, required)
  - `maximum_text_length` (null, required)
  - `minimum_from` (null, required)
  - `sources` (array of string, required, min items 2, max items 2)
  - `restart_required` (`false`, required)
  - `yaml_requires_restart` (`true`, required)

## CachePolicySetting

Type: object or object

Five bounded existing policies. Memory does not consume timeout or concurrency: configured values remain visible with applicable=false, installed values/source are null. Null otherwise means unknown. Defaults/YAML require rollout; whole-block console overrides apply at runtime. Installed entry ceiling is policy, not occupancy or exact remote slot capacity.

- All of (1): any
- All of (2): any
- All of (3): any
- All of (4): any
- All of (5): any
- One of (1): object
  - `value` (null)
  - `source` (null)
- One of (2): object
  - `value` (string)
  - `source` (string)
- `key` (string, required, one of `"cache_backend.timeout"`, `"cache_backend.max_entries"`, `"cache_backend.max_bytes"`, `"cache_backend.max_response_bytes"`, `"cache_backend.max_concurrency"`)
- `group` (`"cache"`, required)
- `value` (string or null, required)
- `default` (string, required, one of `"250ms"`, `"256"`, `"33554432"`, `"65536"`, `"16"`)
- `source` (string or null, required, one of `"default"`, `"yaml"`, `"console"`, `null`)
- `restart_required` (boolean, required)
- `applicable` (boolean, required)

## CacheSettingsSummary

Type: object

Safe desired policy and installed-manager policy, under boot_settings_view. No endpoint, namespace, credentials, ENV, certificate references or service probes. The layers may span an asynchronous control refresh; no atomic match or health claim.

- `configured` ([CacheConfiguredSettings](/docs/api/schemas/c/#cacheconfiguredsettings), required)
- `process` (object, required)
  - `backend` (string or null, required, one of `"memory"`, `"redis"`, `"memcached"`, `null`)
  - `enabled` (boolean, required) — Current flags permit the viable installed manager; alias policy/client opt-in still apply.
  - `state` (string, required, one of `"constructed"`, `"pending_retry"`, `"invalid"`, `"unavailable"`) — Construction/application state, never service health. A failed desired target keeps last-valid installed policy.
  - `settings` (array of [CachePolicySetting](/docs/api/schemas/c/#cachepolicysetting), required, min items 5, max items 5)

## CalendarBudgetPeriodParameterDefinition

Type: object

- `key` (`"quotas.policies[].budget_period"`, required)
- `group` (`"quota"`, required)
- `kind` (`"calendar_budget_period"`, required)
- `values` (`["day","week","month","quarter","year"]`, required)
- `default` (`null`, required)
- `creation_preset` (`"day"`, required)
- `timezone` (`"UTC"`, required)
- `week_start` (`"monday"`, required)
- `quarter_start_months` (`[1,4,7,10]`, required)
- `year_start_month` (`1`, required)
- `sources` (`["yaml","console"]`, required)
- `restart_required` (`false`, required)
- `yaml_requires_restart` (`true`, required)

## CanaryAliasStatus

Type: object

One alias with a canary policy on the answering replica (process-local counters).

- `alias` (string, required)
- `enabled` (boolean, required)
- `target` (integer, required, min 0)
- `percent` (integer, required, min 0, max 100)
- `effective_percent` (integer, required, min 0, max 100) — 0 with the flag off or after a rollback
- `sticky` (string, required, one of `"key"`, `"session"`, `"request"`)
- `header` (string)
- `stable_requests` (integer (int64), required, min 0)
- `stable_failures` (integer (int64), required, min 0)
- `canary_requests` (integer (int64), required, min 0)
- `canary_failures` (integer (int64), required, min 0)
- `window_outcomes` (integer, required, min 0)
- `window_failures` (integer, required, min 0)
- `window_latency_ms` (number or null, required)
- `auto_rollback` (boolean, required)
- `rolled_back` (boolean, required)
- `rolled_back_at` (string (date-time))
- `rollback_reason` (string, one of `"error_rate"`, `"latency"`)
- `rollback_stored` (string, one of `"local"`, `"stored"`, `"superseded"`, `"conflict"`, `"failed"`, `"file_owned"`) — Whether the rollback was written as a routing version
- `shadow` (object)
  - `target` (integer, min 0)
  - `enabled` (boolean)
  - `percent` (integer)
  - `max_concurrency` (integer)
  - `in_flight` (integer, min 0)
  - `sent` (integer (int64), min 0)
  - `completed` (integer (int64), min 0)
  - `failed` (integer (int64), min 0)
  - `dropped` (integer (int64), min 0)
  - `sampled_out` (integer (int64), min 0)
  - `not_eligible` (integer (int64), min 0)
  - `unavailable` (integer (int64), min 0)
  - `last_status` (integer)

## CanaryPolicy

Type: object

Canary split (canary_routing). A keyed digest of the key (sticky key, default), of the session header (sticky session; the key without one) or a per-request draw (sticky request) puts a request on the canary side with probability percent. The stable side never reaches the canary or shadow target; the canary side tries the canary target first and falls back to the stable ones. Continuations (previous_response_id, conversations) keep every target but the shadow, whatever the flag. The canary and shadow targets need a provider and model no other target uses. With the flag off an alias with a policy routes to its stable targets only. Not with a wildcard alias, auto_route or passthrough; at least one stable target besides the canary and shadow.

- `target` (integer, required, min 0) — Index of the canary target in targets
- `percent` (integer, required, min 0, max 100)
- `sticky` (string, one of `"key"`, `"session"`, `"request"`) — Default key
- `header` (string, max length 64, pattern `^[A-Za-z0-9-]+$`) — Session header (sticky session only); default X-Gateway-Session-Id; never a credential or hop-by-hop header
- `shadow` (object) — With canary_shadow, a sample of stateless Chat Completions, embeddings, moderations, rerank, Messages and Responses requests is copied in the background to this target as the same key, charged and tagged shadow=true; its answer is discarded, caches, fallbacks, captures and affinity are bypassed and RPM is not counted. Past max_concurrency a copy is dropped.
  - `target` (integer, required, min 0) — Index of the shadow target in targets (not the canary)
  - `percent` (integer, min 1, max 100) — Sampled share; default 100
  - `max_concurrency` (integer, min 1, max 64) — Copies in flight for the alias per replica; default 4; 64 for every alias together
- `auto_rollback` (object) — With canary_auto_rollback, the canary percent drops to 0 on the replica when the canary target's failure share (transport, 401, 403, 408, 429, 5xx) or its mean buffered header latency in the window passes its threshold after min_requests outcomes, and is written as an auto_rollback routing version when routing_versions and PostgreSQL allow. Promotion stays a human save.
  - `min_requests` (integer, min 5, max 10000) — Default 20
  - `max_error_rate` (number, min 0.01, max 1) — Default 0.5
  - `max_latency` (string) — Go duration 1ms..10m; unset means latency does not trigger
  - `window` (string) — Go duration 1m..1h; default 5m
  - `evaluation_teams` (array of string, max items 64) — T186.015, route_experiments: the teams whose route experiments with guarded_rollback may roll this canary back on their evaluator's pass rate (reason evaluation_pass_rate); empty, none may

## CatalogArchiveRow

Type: object

- `id` (integer (int64), required)
- `kind` (string, required, one of `"price"`, `"price_retired"`, `"model"`, `"model_retired"`)
- `provider_id` (string, required)
- `model_id` (string, required)
- `input_per_million` (string)
- `output_per_million` (string)
- `effective_from` (string (date-time), required)
- `effective_to` (string (date-time))
- `state` (string, required, one of `"current"`, `"scheduled"`, `"archived"`)
- `source` (string, required)
- `source_url` (string)
- `draft_id` (string, required)
- `entry` (integer, required)
- `approved_by` (string, required)
- `approved_at` (string (date-time), required)

## CatalogDraft

Type: object

- `id` (string, required)
- `source` (string, required)
- `source_url` (string, required)
- `fetched_at` (string (date-time))
- `status` (string, required, one of `"open"`, `"closed"`, `"superseded"`)
- `entries` (integer, required, min 0, max 5000)
- `pending` (integer, required, min 0, max 5000)
- `created_at` (string (date-time), required)
- `created_by` (string, required)
- `closed_at` (string (date-time))
- `items` (array of object, max items 5000)
  - `entry` (integer, required, min 1)
  - `kind` (string, required, one of `"price"`, `"model"`)
  - `change` (string, required, one of `"new"`, `"changed"`, `"removed"`)
  - `provider_id` (string, required)
  - `model_id` (string, required)
  - `input_per_million` (string) — USD per million input tokens
  - `output_per_million` (string) — USD per million output tokens
  - `previous_input_per_million` (string)
  - `previous_output_per_million` (string)
  - `previous_archive_id` (integer (int64))
  - `decision` (string, required, one of `"pending"`, `"approved"`, `"rejected"`, `"superseded"`)
  - `decided_at` (string (date-time))
  - `decided_by` (string)
  - `archive_id` (integer (int64))

## ChargeAccountingSettings

Type: object

The effective charge_accounting.* boot settings (T183), under their YAML names; a configuration rollout changes them. Each report carries the keys it explains - the durable usage report the worker bounds, the consistency report its tolerance.

- `recovery_batch` (integer, min 1, max 500) — charge_accounting.recovery_batch (default 100): receipts one recovery pass resumes.
- `recovery_grace_seconds` (integer, min 60, max 86400) — charge_accounting.recovery_grace_seconds (default 300): how long a final receipt waits before the worker resumes its open reservation.
- `background_poll_seconds` (integer, min 5, max 3600) — charge_accounting.background_poll_seconds (default 30): how often the background response worker asks the provider.
- `background_max_age_seconds` (integer, min 600, max 604800) — charge_accounting.background_max_age_seconds (default 86400): how long a background response is tracked.
- `consistency_tolerance_usd` (string) — charge_accounting.consistency_tolerance_usd (default 0.000001): the largest budget charge versus estimate difference that still counts as consistent.

## ChargeConsistencyReport

Type: object

- `from` (string (date-time), required)
- `to` (string (date-time), required)
- `bucket_seconds` (integer, required, one of `3600`, `86400`)
- `charge_accounting` ([ChargeAccountingSettings](/docs/api/schemas/c/#chargeaccountingsettings), required)
- `totals` ([ChargeConsistencyWindow](/docs/api/schemas/c/#chargeconsistencywindow), required)
- `windows` (array of [ChargeConsistencyWindow](/docs/api/schemas/c/#chargeconsistencywindow), required, max items 2161)
- `estimate_unknown_reasons` (array of object, required, max items 10)
  - `reason` (string, required)
  - `events` (integer (int64), required)

## ChargeConsistencyWindow

Type: object

- `start` (string (date-time)) — Window start; absent on the totals
- `events` (integer (int64), required)
- `linked` (integer (int64), required) — Events linked to a reservation priced in USD
- `consistent` (integer (int64), required) — Both sides known and within charge_accounting.consistency_tolerance_usd
- `reconciliation` (integer (int64), required) — Differ because the budget took the provider invoice
- `margin` (integer (int64), required) — Differ because discounts or margins changed the estimate
- `rate` (integer (int64), required) — Differ because the price book or catalog price is not the approved rate
- `only_budget_known` (integer (int64), required)
- `only_estimate_known` (integer (int64), required) — The reservation is still held
- `neither_known` (integer (int64), required)
- `unlinked` (integer (int64), required)
- `archived` (integer (int64), required)
- `tokens_only` (integer (int64), required)
- `estimated_usd` (string, required) — Sum of the estimates where both sides are known
- `budget_charged_usd` (string, required) — Sum of the budget charges where both sides are known

## ClientSourceMetadataSettings

Type: object

The client_source_metadata boot settings (T033.003, T183), effective, read-only. The flag client_source_metadata decides whether addresses are stored at all.

- `retention_days` (integer, required, min 1, max 30) — client_source_metadata.retention_days (default 7): how long a stored client address is kept.
- `read` (string, required, one of `"global"`, `"team"`) — client_source_metadata.read (default global): global shows addresses to global administrator and viewer roles only; team also to team roles with logs:read, for their own teams' requests.

## CodeModeConfig

Type: object

extensions.code_mode (T031.003, flag mcp_code_mode), the bounds of one program.

- `max_program_bytes` (integer, required) — extensions.code_mode.max_program_bytes (default 16 KiB)
- `max_steps` (integer, required) — extensions.code_mode.max_steps (default 25): tool steps per run, then step_limit.
- `timeout_ms` (integer, required) — extensions.code_mode.timeout_ms (default 15000): the whole run.
- `step_timeout_ms` (integer, required) — extensions.code_mode.step_timeout_ms (default 10000): one tool call.
- `max_result_bytes` (integer, required) — extensions.code_mode.max_result_bytes (default 64 KiB): the run result.
- `max_step_bytes` (integer, required) — extensions.code_mode.max_step_bytes (default 256 KiB): one tool answer.
- `memory_pages` (integer, required) — extensions.code_mode.memory_pages (default 1024): 64 KiB pages.
- `heap_bytes` (integer, required) — extensions.code_mode.heap_bytes (default 32 MiB): the JavaScript heap.
- `search_limit` (integer, required) — extensions.code_mode.search_limit (default 10): tools one search returns.
- `team_concurrency` (integer, required) — extensions.code_mode.team_concurrency (default 2): runs per team per replica; past it 429 code_mode_busy.

## CodexKnownModel

Type: object

The client's own catalog entry for the model every target of the alias names (all of its fields, including model_messages, reasoning levels and service tiers, as the vendored release wrote them). Rewritten: slug and display_name (the alias ID), priority, visibility list, supported_in_api true, upgrade and availability_nux null; context_window only when every target declares max_input_tokens (the smallest, capped at max_context_window). With models[].codex.base_instructions, base_instructions is that text and model_messages.instructions_template is removed; otherwise there is no base_instructions and the client builds the model's prompt from model_messages.

- `slug` (string, required) — The alias ID, the name the client sends as model
- `display_name` (string, required) — The alias ID
- `visibility` (`"list"`, required)
- `supported_in_api` (`true`, required)
- `priority` (integer, required, min 0) — Position in this answer; the client sorts its picker by it
- `upgrade` (null)
- `availability_nux` (null)
- `model_messages` (object, required)
- `base_instructions` (string, max length 65536) — Present only with models[].codex.base_instructions
- `context_window` (integer, min 1)

## CodexModelCatalog

Type: object

codex_model_catalog (T148): the Codex CLI ModelsResponse. Only aliases with the responses capability (openai_responses on) that the key may call, only when the key may use route:responses and, with feature_plan_entitlements on, the team plan grants openai_responses for the model; never a wildcard alias's own pattern; in declaration order; at most 1 MiB (aliases that do not fit are left out). Each entry is either the client's own entry for a model its catalog knows (vendored from the open-source Codex repository, every target of the alias naming that model and the client at or past its minimal_client_version), renamed to the alias, or a translated entry whose fields the gateway cannot know carry the client's own values for a model it has no metadata for.

- `models` (array of [CodexKnownModel](/docs/api/schemas/c/#codexknownmodel) or [CodexTranslatedModel](/docs/api/schemas/c/#codextranslatedmodel), required)
  - One of (1): [CodexKnownModel](/docs/api/schemas/c/#codexknownmodel)
  - One of (2): [CodexTranslatedModel](/docs/api/schemas/c/#codextranslatedmodel)

## CodexTranslatedModel

Type: object

Entry for a model the client's catalog does not know.

- `slug` (string, required) — The alias ID, the name the client sends as model
- `display_name` (string, required) — The alias ID
- `description` (null, required)
- `default_reasoning_level` (null, required)
- `supported_reasoning_levels` (array of any, required, max items 0)
- `shell_type` (`"default"`, required)
- `visibility` (`"list"`, required)
- `supported_in_api` (`true`, required)
- `priority` (integer, required, min 0) — Position in this answer; the client sorts its picker by it
- `base_instructions` (string, required, min length 1, max length 65536) — models[].codex.base_instructions when set, else the client's generic base prompt (prompt.md of the vendored Codex release)
- `support_verbosity` (`false`, required)
- `truncation_policy` (object, required)
  - `mode` (`"bytes"`, required)
  - `limit` (`10000`, required)
- `experimental_supported_tools` (array of any, required, max items 0)
- `context_window` (integer, min 1) — Smallest targets[].max_input_tokens, present only when every target of the alias declares one

## ConditionalFractionParameterDefinition

Type: object

- One of (1): object
  - `key` (`"models[].semantic_cache.threshold"`, required)
  - `group` (`"cache"`, required)
  - `kind` (`"conditional_fraction"`, required)
  - `default` (null, required)
  - `minimum` (`"0.5"`, required)
  - `maximum` (`"1"`, required)
  - `required_when` (`"models[].semantic_cache.embedding_model"`, required)
  - `inactive_value` (`"0"`, required)
  - `creation_preset` (`"0.95"`, required)
  - `sources` (array of string, required, min items 2, max items 2)
  - `restart_required` (`false`, required)
  - `yaml_requires_restart` (`true`, required)

## ConsoleUser

Type: object

- `custom_role_id` ([CustomRoleID](/docs/api/schemas/c/#customroleid)) — Optional restrictive console role; builtin role and inference authority stay separate.
- `id` (string, required, pattern `^usr_[a-f0-9]{32}$`)
- `name` (string, required)
- `role` (string, required, one of `"admin"`, `"viewer"`, `"team_viewer"`, `"team_admin"`, `"operator"`, `"user"`)
- `team_ids` (array of string, required) — Active team memberships; empty for global roles
- `admin_team_ids` (array of string) — Memberships with role admin
- `memberships` (array of [Membership](/docs/api/schemas/m/#membership))
- `version` (integer (int64), required, min 0) — Per-user optimistic concurrency version
- `created_at` (string (date-time), required)
- `disabled_at` (string (date-time))
- `provisioning` (string, one of `"scim"`, `"jit"`) — scim when the identity provider owns the lifecycle through SCIM; jit when a first federated login created the user
- `approval` (string, one of `"pending"`, `"approved"`, `"rejected"`) — The administrator decision on a JIT user (federated_jit)
- `federation` (string, one of `"oidc"`, `"saml"`) — The protocol of a JIT user's federated identity

## ContentCapturePolicy

Type: object

One team's content capture policy (T113); the same fields as content_capture.policies[] in YAML.

- `team` (string) — Must match the path when present
- `capture` (string, one of `"request"`, `"response"`, `"both"`, default `"both"`)
- `sample_rate` (number, default `1`, max 1, greater than 0)
- `retention_days` (integer, default `30`, min 1, max 3650)
- `max_bytes` (integer, default `65536`, min 1024, max 1048576) — Per side; a longer body is cut and flagged truncated
- `keys` (array of string, max items 50) — Key IDs; empty means every key of the team
- `models` (array of string, max items 50) — Model aliases the client sent; empty means every model
- `disabled` (boolean, default `false`) — Turns a YAML policy off from the console
- `request_view` (string, one of `"received"`, `"sent"`, `"both"`) — T186.005, applies with content_capture_evaluation: the copies of the request a record keeps. received is the request as the client sent it; sent is the request as the gateway holds it after its input stage (mandatory system prompt added, input guardrails applied); both keeps the two. Default: received for the audit purpose alone, sent for evaluation alone, both for the two. With the flag off only a policy that keeps received captures, and it captures received.
- `purposes` (array of string, default `["audit"]`, max items 2) — T186.005, applies with content_capture_evaluation: who may use a record. audit: people with a content:read grant. evaluation: live evaluation rules, review queues, session transcripts and dataset imports, which read only the sent view and the answer; it needs capture both and request_view sent or both; a policy for evaluation alone stores only served requests a judge can read. With the flag off a policy without audit captures nothing.
- `evaluation` (object) — T186.005, applies with content_capture_evaluation: the evaluation purpose's own limits, each optional and never wider than the policy; they need the evaluation purpose. Audit keeps the policy's sampling, models, operations and retention. A captured request the limits leave out is an audit record only: it is not judged, not reported as skipped and not readable through the evaluation screens.
  - `sample_rate` (number, max 1, greater than 0) — Share of the captured requests that also carry the evaluation purpose, decided by the request ID (the same request always decides the same way). Default: all of them.
  - `retention_days` (integer, min 1, max 3650) — Days judges and evaluation reviewers may read a record, at most the policy's retention_days. Default: the policy's retention.
  - `models` (array of string, max items 50) — Only these models are evaluated; each must be a model the policy captures. Default: every captured model.
  - `operations` (array of string, max items 4) — Only these operations are evaluated, among those the policy captures. Default: every captured operation.
- `operations` (array of string, max items 4) — T186.005, applies with content_capture_evaluation: the operations the policy captures; empty or omitted means all four. With the flag off a policy that lists fewer than four captures nothing.
- `media` (object) — T186.005, applies with content_capture_media: the bounds of the team's captured images and audio, kept as encrypted attachments beside the record. Each field is optional; stored and not applied while the flag is off.
  - `disabled` (boolean, default `false`) — Keeps this team's media out of the store with the flag on.
  - `max_items` (integer, default `4`, min 1, max 16) — Attachments stored per record, request and answer together; further ones are named (type, size, hash) and not stored.
  - `max_item_bytes` (integer, default `2097152`, min 1024, max 10485760) — Size of one attachment, decoded; a larger one is named and not stored, never cut.
  - `max_team_bytes` (integer (int64), default `1073741824`, min 1048576, max 107374182400) — Everything the team's retained records keep in the media store; a record that would pass it is written without media.
- `identifiers` (string, one of `"plain"`, `"hashed"`, default `"plain"`) — T204: how the team's organization, team and key IDs leave the gateway as attribution metadata, today the provider request labels (provider_request_labels). plain sends the IDs; hashed sends a keyed digest of each. It applies whenever the team has a policy, also a disabled one and with content_capture off: it restricts what is sent and captures nothing. A write that omits it keeps the team's current value (console policy, else YAML entry); send plain to go back. Omitted in answers when it was never set.

## ContextOverflowPolicy

Type: object

T168, features.context_overflow (requires context_window_check): what the alias does with a request whose input estimate is clearly above its targets' max_input_tokens, before guardrails, quota and caches, on Chat Completions, the Messages and Responses requests translated through it, and native Messages and Responses. In order: escalate (a target that fits takes it), truncate (drop the oldest turns; system and developer messages and every tool call with its results kept, the latest turn always kept), summarize_model (replace the oldest turns with one summary from that chat alias, called as the caller's key with request ID &lt;id&gt;.summary and billed to it). Otherwise refused with 400 context_length_exceeded. Answers carry X-Gateway-Context-Overflow: none, escalated, truncated;dropped=N, summarized;dropped=N;model=&lt;alias&gt; or refused. Requires max_input_tokens on a target; validated even when the flag is off. A stateful Responses request is left alone.

- `escalate` (boolean, default `true`) — false: compress for the smallest window instead of moving to a larger target
- `truncate` (boolean, default `false`)
- `summarize_model` (string) — Another chat alias that does not summarize itself
- `summary_max_tokens` (integer, default `512`, min 64, max 4096) — Requires summarize_model
- `target_percent` (integer, default `80`, min 10, max 100) — Share of the window the compressed input may fill by the gateway's estimate (a floor of the real count)

## CostAdjustments

Type: object

- `discounts` (object) — Fraction off what a provider costs, by provider ID or global; a provider entry replaces the global one
  - any other key: number
- `margins` (object) — Margin added for internal billing, by provider ID or global
  - any other key: object
    - `percent` (number, min 0, max 10)
    - `fixed_usd` (number, min 0, max 10) — Fixed fee per request in USD

## CostAdjustmentsView

Type: object

- `version` (integer, required)
- `source` (string, required, one of `"default"`, `"yaml"`, `"console"`)
- `cost_adjustments` ([CostAdjustments](/docs/api/schemas/c/#costadjustments), required)
- `base` ([CostAdjustments](/docs/api/schemas/c/#costadjustments), required)
- `override_ignored` (string, required) — Why a stored override does not apply (it no longer validates, for example a provider it names left the YAML); empty when it applies or there is none
- `editable` (boolean, required) — Whether the policy can be edited; always true in a running gateway, since PostgreSQL is mandatory

## CustomerBudgetWindow

Type: object

- `budget_usd` (string, required) — Positive decimal, up to six places
- `budget_period` (string, one of `"day"`, `"week"`, `"month"`, `"quarter"`, `"year"`, `"lifetime"`, default `"month"`) — Unique within the level; week, quarter and year need calendar_budget_periods, lifetime needs lifetime_budget_limits

## CustomerCredential

Type: object

- `id` (string, required, pattern `^cpc_[a-f0-9]{16}$`)
- `team_id` (string, required)
- `name` (string, required)
- `access` (string, required, one of `"read"`, `"manage"`)
- `expires_at` (string (date-time))
- `revoked_at` (string (date-time))
- `created_by` (string, required)
- `revoked_by` (string)
- `created_at` (string (date-time), required)
- `last_used_at` (string (date-time)) — Recorded at most once a minute
- `state` (string, required, one of `"active"`, `"expired"`, `"revoked"`)

## CustomerExport

Type: object

- `format` (`"customer-portal/v1"`, required)
- `team` (string) — The exporting team; ignored on import
- `organization` ([CustomerRecord](/docs/api/schemas/c/#customerrecord), required)
- `profiles` (array of [CustomerRecord](/docs/api/schemas/c/#customerrecord), required)
- `teams` (array of [CustomerRecord](/docs/api/schemas/c/#customerrecord), required)
- `members` (array of [CustomerRecord](/docs/api/schemas/c/#customerrecord), required)
- `exported_at` (string (date-time))

## CustomerModelAllowance

Type: object

- `model` (string, required, max length 128) — A configured model alias; the allowance counts only requests for it
- `budget_usd` (string, required) — Positive decimal, up to six places; a hard ceiling reserved with the level's other budgets
- `budget_period` (string, one of `"day"`, `"week"`, `"month"`, `"quarter"`, `"year"`, `"lifetime"`, default `"month"`)
- `fallback_model` (string, max length 128) — A cheaper configured alias. When the allowance is exhausted, a chat-pipeline request (Chat Completions, or Messages and Responses translated through it) is answered through it once in its own dialect (X-Gateway-Fallback allowance:&lt;alias&gt;), admitted like a client request of the same key and charged to the same customer; native routes and refused destinations get the original 429 with X-Gateway-Fallback-Refused

## CustomerOrganizationDetail

Type: object

- `organization` ([CustomerRecord](/docs/api/schemas/c/#customerrecord), required)
- `teams` (array of [CustomerRecord](/docs/api/schemas/c/#customerrecord), required)
- `members` (array of [CustomerRecord](/docs/api/schemas/c/#customerrecord), required)
- `profiles` (array of [CustomerRecord](/docs/api/schemas/c/#customerrecord), required)
- `truncated` (boolean, required)
- `observed_at` (string (date-time), required)

## CustomerOverrideRequest

Type: object

- `id` (string, required, pattern `^cor_[a-f0-9]{16}$`)
- `team_id` (string, required)
- `org_id` (string, required)
- `member` (string, required)
- `budget_usd` (string, required)
- `expires_at` (string (date-time), required) — When the requested override would end
- `reason` (string)
- `budget_period` (string) — The budget window the override would replace; absent, the member's first window
- `state` (string, required, one of `"pending"`, `"approved"`, `"denied"`, `"expired"`)
- `requested_by` (string, required) — Console user ID, bootstrap_admin or customer credential ID
- `decided_by` (string)
- `decision_note` (string)
- `applied_version` (integer (int64)) — The member version the approval wrote
- `created_at` (string (date-time), required)
- `decide_by` (string (date-time), required)
- `decided_at` (string (date-time))

## CustomerPortalSettings

Type: object

The customer_portal.* boot settings (T158.004-006, T183), effective values under their YAML names. A change is a configuration rollout.

- `auto_register_organizations` (boolean, required) — customer_portal.auto_register_organizations (default false): a trusted key naming an unknown organization registers it, in the key's own team, with the default member profile.
- `max_auto_organizations` (integer, required, min 1, max 10000) — customer_portal.max_auto_organizations (default 100): the most auto-registered organizations one operator team may hold.
- `auto_organization_profile` (object, required) — customer_portal.auto_organization_profile: the ceiling of an auto-registered organization and its default member profile.
  - `id` (string, required) — The profile ID (default default).
  - `budget_usd` (string, required) — Its ceiling; empty while auto-registration is off and none was set.
  - `budget_period` (string, required, one of `"day"`, `"week"`, `"month"`, `"quarter"`, `"year"`, `"lifetime"`) — Default month.
  - `organization_budget_usd` (string, required) — The organization's own hard ceiling, over all its members; required while auto-registration is on (the gateway refuses to start without it).
  - `organization_budget_period` (string, required, one of `"day"`, `"week"`, `"month"`, `"quarter"`, `"year"`, `"lifetime"`) — Default month.
- `require_override_approval` (boolean, required) — customer_portal.require_override_approval: member overrides need an approval request that another person decides; only a global administrator writes one directly.
- `override_request_ttl_hours` (integer, required, min 1, max 8784) — customer_portal.override_request_ttl_hours (default 168): how long a pending approval request may be decided.
- `auto_register_members` (boolean, required) — customer_portal.auto_register_members: a trusted key naming an unknown member of a registered, enabled organization registers it from the default profile.
- `view_token_max_minutes` (integer, required, min 1, max 10080) — customer_portal.view_token_max_minutes (default 1440): the longest self-service view token.

## CustomerRecord

Type: object

- `team_id` (string, required)
- `org_id` (string, required)
- `kind` (string, required, one of `"org"`, `"team"`, `"member"`, `"profile"`)
- `id` (string, required)
- `name` (string, required)
- `version` (integer (int64), required)
- `customer_team` (string)
- `profile_id` (string)
- `budget_usd` (string)
- `budget_period` (string, required)
- `soft_budget` (boolean, required)
- `alert_thresholds` (array of integer, required)
- `override` (object)
  - `budget_usd` (string, required)
  - `expires_at` (string (date-time), required)
  - `reason` (string)
  - `budget_period` (string) — The budget window the override replaces; absent, the first
- `budgets` (array of [CustomerBudgetWindow](/docs/api/schemas/c/#customerbudgetwindow)) — The level's own budget windows, shortest period first ([] without a budget); budget_usd and budget_period are the first one
- `auto_registered` (boolean) — An organization registered by a trusted key's request (customer_portal.auto_register_organizations)
- `disabled` (boolean, required)
- `tpm` (integer (int64))
- `tpd` (integer (int64))
- `model_allowances` (array of [CustomerModelAllowance](/docs/api/schemas/c/#customermodelallowance))
- `created_at` (string (date-time), required)
- `updated_at` (string (date-time), required)
- `effective` (object)
  - `budget_usd` (string)
  - `budget_period` (string, required)
  - `source` (string, required, one of `"override"`, `"own"`, `"profile"`, `"none"`)
  - `soft_budget` (boolean, required)
  - `committed_usd` (string, required) — Settled spend plus open holds in the current window
  - `window_start` (string (date-time), required)
  - `windows` (array of object) — Every effective budget window with its own committed spend; the fields beside it describe the first. Empty without a budget
    - `budget_usd` (string, required)
    - `budget_period` (string, required)
    - `committed_usd` (string, required)
    - `window_start` (string (date-time), required)
    - `source` (string, required, one of `"override"`, `"own"`, `"profile"`)

## CustomerRecordInput

Type: object

- `version` (integer (int64), min 1) — Omit to create; the current version to replace
- `name` (string, max length 120)
- `customer_team` (string) — Members only: the customer team, which is charged too
- `profile_id` (string) — Member: the profile it follows when it has no budget. Organization or team: the default profile of new members
- `budget_usd` (string) — Positive decimal, up to six places; omitted means no ceiling (spend is still counted). Required for a profile
- `budget_period` (string, one of `"day"`, `"week"`, `"month"`, `"quarter"`, `"year"`, `"lifetime"`, default `"month"`)
- `soft_budget` (boolean, default `false`) — Alert without refusing
- `alert_thresholds` (array of integer, max items 5) — Default [80, 100]; [] disables alerts
- `disabled` (boolean, default `false`) — Refuse every request that names this level
- `tpm` (integer (int64), min 0, max 1000000000000) — Tokens per minute of this level (0 none); needs tpm_limits. A member without its own follows its profile's
- `tpd` (integer (int64), min 0, max 1000000000000) — Tokens per UTC day of this level (0 none); needs tpd_limits and tpm_limits
- `model_allowances` (array of [CustomerModelAllowance](/docs/api/schemas/c/#customermodelallowance), max items 16) — Hard per-model USD allowances, unique per model alias. A member without its own follows its profile's
- `budgets` (array of [CustomerBudgetWindow](/docs/api/schemas/c/#customerbudgetwindow), max items 4) — Budget windows with distinct periods, all enforced together; more than one needs customer_budget_windows (422 feature_disabled). Several entries are the whole list, and a budget_usd sent with them must be their shortest window's (422 otherwise). One entry beside a different budget_usd is settled against the stored record: the side that still equals it is what the client read and the other is the change, so a client that reads a record and changes budget_usd keeps working, and so does reducing several windows to one; two budgets that are both new (also on a create) answer 422 invalid_customer

## CustomerTrustedKey

Type: object

- `key_id` (string, required)
- `team_id` (string, required) — The key's team; only its customers can be named
- `require_identity` (boolean, required)
- `source` (string, required, one of `"yaml"`, `"console"`)
- `actor` (string)
- `created_at` (string (date-time))

## CustomerUsageReport

Type: object

- `from` (string (date-time), required)
- `to` (string (date-time), required)
- `team` (string, required)
- `org` (string)
- `by` (string, required, one of `"org"`, `"team"`, `"member"`, `"day"`, `"model"`, `"day,model"`)
- `truncated` (boolean, required)
- `rows` (array of object, required)
  - `org` (string, required)
  - `customer_team` (string)
  - `member` (string)
  - `day` (string (date-time))
  - `model` (string) — The served model alias (by=model and by=day,model)
  - `requests` (integer (int64), required)
  - `input_tokens` (integer (int64), required)
  - `output_tokens` (integer (int64), required)
  - `estimated_usd` (string, required)
  - `valued_known` (integer (int64), required)
  - `valued_partial` (integer (int64), required)
  - `valued_unknown` (integer (int64), required)
  - `not_valued` (integer (int64), required)
  - `tokens_unknown` (integer (int64), required)
  - `budget_charge` ([BudgetChargeSummary](/docs/api/schemas/b/#budgetchargesummary))

## CustomerViewToken

Type: object

- `id` (string, required, pattern `^cvt_[a-f0-9]{16}$`)
- `team_id` (string, required)
- `org_id` (string, required)
- `member` (string)
- `expires_at` (string (date-time), required)
- `created_by` (string, required)
- `created_at` (string (date-time), required)

## CustomRoleBindingRevert

Type: object

- `version` (integer (int64), required, min 0)
- `expected_base_fingerprint` (string, required, min length 64, max length 64, pattern `^[a-f0-9]{64}(?![\s\S])`)
- `user_version` (integer (int64), required, min 0)

## CustomRoleBindingView

Type: object

- `user_id` (string, required, min length 36, max length 36, pattern `^usr_[a-f0-9]{32}(?![\s\S])`)
- `role_id` ([CustomRoleID](/docs/api/schemas/c/#customroleid) or null, required)
  - One of (1): [CustomRoleID](/docs/api/schemas/c/#customroleid)
  - One of (2): null
- `source` (string, required, one of `"yaml"`, `"console"`, `"none"`)
- `declared` (boolean, required)
- `user_version` (integer (int64), required, min 0)

## CustomRoleBindingWrite

Type: object

- `version` (integer (int64), required, min 0)
- `expected_base_fingerprint` (string, required, min length 64, max length 64, pattern `^[a-f0-9]{64}(?![\s\S])`)
- `user_version` (integer (int64), required, min 0)
- `role_id` ([CustomRoleID](/docs/api/schemas/c/#customroleid) or null, required)
  - One of (1): [CustomRoleID](/docs/api/schemas/c/#customroleid)
  - One of (2): null

## CustomRoleCatalog

Type: object

- `version` (integer (int64), required, min 0)
- `base_fingerprint` (string, required, min length 64, max length 64, pattern `^[a-f0-9]{64}(?![\s\S])`)
- `stored_base_fingerprint` (string, required, max length 64, pattern `^([a-f0-9]{64})?(?![\s\S])`)
- `base_mismatch` (boolean, required)
- `roles` (array of [CustomRoleView](/docs/api/schemas/c/#customroleview), required, max items 64)
- `bindings` (array of [CustomRoleBindingView](/docs/api/schemas/c/#customrolebindingview), required, max items 500)
- `permission_catalog` (array of [CustomRolePermissionDefinition](/docs/api/schemas/c/#customrolepermissiondefinition), required, max items 40)
- `enabled` (boolean, required)
- `management_enabled` (boolean, required)
- `access` (object, required)
  - `write` (boolean, required)
- `limits` ([CustomRoleLimits](/docs/api/schemas/c/#customrolelimits), required)

## CustomRoleDefinition

Type: any and any and any and any and any

- All of (1): any
- All of (2): any
- All of (3): any
- All of (4): any
- All of (5): any
- `id` ([CustomRoleID](/docs/api/schemas/c/#customroleid), required)
- `name` (string, required, min length 1, max length 128) — Canonical trimmed non-control name; server enforces at most128 UTF-8 bytes.
- `base_role` (string, required, one of `"viewer"`, `"operator"`, `"user"`, `"team_viewer"`, `"team_admin"`)
- `permissions` (array of string, required, max items 64)
- `disabled` (boolean, required, default `false`)

## CustomRoleID

Type: string, min length 2, max length 64, pattern `^[a-z][a-z0-9_-]{1,63}(?![\s\S])`

## CustomRoleLimits

Type: object

- `max_roles` (`64`, required)
- `max_bindings` (`500`, required)
- `max_permissions` (`64`, required)
- `id_max_bytes` (`64`, required)
- `name_max_bytes` (`128`, required)

## CustomRolePermission

Type: string, one of `"access_groups:read"`, `"alert_rules:global"`, `"alert_rules:read"`, `"alerts:read"`, `"analytics:read"`, `"audit:read"`, `"batches:read"`, `"boot_settings:read"`, `"catalog:read"`, `"config:read"`, `"containers:read"`, `"content_media:read"`, `"content_reasoning:read"`, `"content_sent:read"`, `"content_structure:read"`, `"destinations:read"`, `"endpoints:read"`, `"evals:read"`, `"evaluators:publish"`, `"evaluators:test"`, `"features:read"`, `"fine_tuning:read"`, `"guardrails:read"`, `"keys:create"`, `"keys:delete"`, `"keys:read"`, `"keys:revoke"`, `"keys:rotate"`, `"local_inference:read"`, `"logging:read"`, `"logs:read"`, `"mcp:read"`, `"monitors:global"`, `"monitors:read"`, `"mcp_connect:read"`, `"models:read"`, `"organizations:read"`, `"playground:use"`, `"prices:read"`, `"prompts:delete"`, `"prompts:publish"`, `"prompts:read"`, `"prompts:write"`, `"providers:read"`, `"quotas:read"`, `"rates:read"`, `"realtime:read"`, `"recycle_bin:read"`, `"requests:replay"`, `"resilience:read"`, `"reviews:annotate"`, `"reviews:assign"`, `"reviews:calibrate"`, `"saved_views:read"`, `"saved_views:save"`, `"saved_views:share"`, `"dashboards:read"`, `"dashboards:save"`, `"dashboards:share"`, `"session:read"`, `"skills:read"`, `"teams:read"`, `"vector_stores:read"`, `"workloads:read"`

## CustomRolePermissionDefinition

Type: object

- `id` ([CustomRolePermission](/docs/api/schemas/c/#customrolepermission), required)
- `base_roles` (array of string, required, min items 1, max items 5)
- `kind` (string, required, one of `"read"`, `"key_action"`, `"prompt_action"`)
- `requires_delegation` (boolean, required) — Fine action still requires its existing explicit team/delegation authority; a custom role never grants membership or replaces the team policy.

## CustomRoleVersionWrite

Type: object

- `version` (integer (int64), required, min 0)
- `expected_base_fingerprint` (string, required, min length 64, max length 64, pattern `^[a-f0-9]{64}(?![\s\S])`)

## CustomRoleView

Type: any and any and any and any and any

- All of (1): any
- All of (2): any
- All of (3): any
- All of (4): any
- All of (5): any
- `id` ([CustomRoleID](/docs/api/schemas/c/#customroleid), required)
- `name` (string, required, min length 1, max length 128) — Canonical trimmed non-control name; server enforces at most128 UTF-8 bytes.
- `base_role` (string, required, one of `"viewer"`, `"operator"`, `"user"`, `"team_viewer"`, `"team_admin"`)
- `permissions` (array of string, required, max items 64)
- `disabled` (boolean, required, default `false`)
- `source` (string, required, one of `"yaml"`, `"console"`)
- `declared` (boolean, required)

## CustomRoleWrite

Type: object

- `version` (integer (int64), required, min 0)
- `expected_base_fingerprint` (string, required, min length 64, max length 64, pattern `^[a-f0-9]{64}(?![\s\S])`)
- `role` ([CustomRoleDefinition](/docs/api/schemas/c/#customroledefinition), required)

