Team settings¶
Team admins can change budgets, content capture, approval rules, allowed providers and model alias selections in Team settings in the console. Providers & budgets and Costs include the budget editor. Other roles see effective values without editing controls. Provider API keys stay in Kubernetes Secrets or gateway environment variables; credentials, connection URLs and routes are managed in deployment configuration.
Model choices use the same route IDs and provider names shown in Get started. For admins, Ready means the provider key is configured (or the route is simulated), and Key missing means it still needs a key. Costs and Providers name the configured token window separately from the UTC calendar-month spending budget.
Defaults and overrides¶
SandboxPolicySet remains the bootstrap and policy default. Overrides live in one
JSON document per team in the existing budget Redis, at
<SANDBOX_BUDGET_KEY_PREFIX>:team-settings:<team-id>. The document contains
revision, updated_by, updated_at and overrides. Enable Redis persistence and
include these documents in backups. Team settings use the existing environment
variables and Helm values.
With STORAGE_BACKEND=postgres, the same documents and revision checks use
PostgreSQL gateway storage. Include that database in backups.
Every request reads effective settings directly from the selected store over the loaded YAML defaults. Changes are visible across gateway replicas immediately. Storage outages fail closed with 503. YAML changes use the normal configuration rollout and keep existing overrides. Reset to policy default removes one override and uses the current loaded YAML default.
| API field | YAML default | Meaning |
|---|---|---|
cost_limit_usd |
budgets.costLimitUsd |
Team budget in USD per UTC calendar month |
soft_cost_limit_usd |
budgets.softCostLimitUsd (unset) |
Advisory monthly threshold; calls continue past it |
capture_content |
captureContent (default none) |
Default step capture: none, redacted, or full |
project_budgets.<project> |
budgets.projectCostLimitsUsd.<project> |
Project budget in the same month; project must already exist |
workflows.<name>.token_limit |
workflows.<name>.tokenLimit |
Token ceiling for each run |
workflows.<name>.cost_limit_usd |
workflows.<name>.costLimitUsd |
USD ceiling for each run |
workflows.<name>.approval_required |
workflows.<name>.approvalRequired (default true) |
Require review at the workflow's approval gate |
workflows.<name>.approval_threshold_usd |
workflows.<name>.approvalThresholdUsd (default 0) |
Require review when run spend at the gate is at least this amount |
workflows.<name>.approver_role |
workflows.<name>.approverRole (default approver) |
approver or admin; admins can always review |
workflows.<name>.required_approvals |
workflows.<name>.requiredApprovals (default 1) |
Integer 1–10 distinct verified reviewers |
workflows.<name>.approval_timeout_seconds |
workflows.<name>.approvalTimeoutSeconds (default 604800) |
Integer 60–604800 seconds from the review gate |
workflows.<name>.allowed_providers |
workflows.<name>.allowedProviders |
Provider names eligible for this workflow |
workflows.<name>.capture_content |
Workflow captureContent, otherwise team default |
Override capture for this workflow's future steps |
model_routes.<alias> |
Alias assignment in model-routing.yaml |
Canonical ID of an existing route |
Dollar overrides must be finite numbers between 0 and 1,000,000; token overrides
must be integers between 0 and 1,000,000,000. Zero is a spending/token ceiling of zero.
An absent team/project YAML limit means unlimited; reset to restore
that default. null explicitly disables either team soft or hard limit; the soft
limit must be at or below a configured hard limit. Numeric fields take JSON numbers.
Capture changes affect future steps. Existing captured text keeps its TTL through
any mode change, and enabling capture starts with the next step. An explicit workflow setting (including none) overrides the team value.
Resetting a workflow override restores its YAML value, or the current team default
when YAML has no workflow value. Redaction, byte limits, access checks and retention
continue to apply; see step content.
Monthly spend limits and alerts¶
In Costs or Team settings, set the team monthly soft limit and monthly budget
(hard limit). Both include conservative reservations across providers and tools.
Soft limits allow work to continue. A reservation that would exceed the hard team
or project budget returns 429, with detail.reason equal to
team_cost_budget_exceeded or project_cost_budget_exceeded, before calling the
provider. Retry-After is the number of seconds to the next UTC calendar month.
An admin can raise the limit sooner; editing a limit keeps the month's spend. Actual
reported usage that exceeds an estimate is charged and blocks subsequent calls. Limits
use configured prices.
GET /v1/team/spend returns team_id, window_start, window_end,
soft_limit_usd, hard_limit_usd, reserved_and_spent_usd, status
(ok, soft_limit, hard_limit), and alerts. All unrestricted team roles can
read it; project-bound credentials use /v1/usage (this endpoint returns 403 for them).
Settings writes retain the admin and revision requirements below.
An alert is retained once per level per UTC month. Each has id, level,
limit_usd, reserved_and_spent_usd, requested_usd, created_at,
webhook_status (disabled, pending, delivered, failed) and attempts.
Reservations trigger alerts when they cross a limit, and the alert stays recorded after settlement.
Hard-limit refusal records the rejected reservation separately as requested_usd.
The Costs → Spend alerts panel shows alerts in the console for every team;
Refresh loads current status. Historical alerts for the month remain visible after
limits change, alongside current status. New months use new counters and alerts.
For outgoing delivery, reuse the team's reviewed notifications.webhookEnv and
notifications.consoleUrl configuration. The gateway checks every 30 seconds,
independently of Temporal, including after a limit is lowered. Spend alerts are
delivered by webhook. Webhooks receive event: team_spend_soft_limit or
team_spend_hard_limit, team identity, the alert fields and a console link.
The Idempotency-Key header equals the alert ID. Delivery is at least once,
so have receivers deduplicate by that key. Redis stores attempts and retry times across replicas
and restarts; up to five attempts use exponential backoff starting at 30 seconds.
Retries cover the current month. After five failures the console reports failure;
operators then inspect the destination configuration. Budget enforcement runs
independently of webhook delivery. Preserve Redis persistence and backups during PostgreSQL cutover.
settings = gateway.team_settings()
settings = gateway.set_spend_limits(soft_limit_usd=80, hard_limit_usd=100, revision=settings["revision"])
print(gateway.team_spend()["alerts"])
gateway.set_content_capture("redacted", revision=settings["revision"], workflow="ResearchWorkflow")
let settings = await gateway.teamSettings();
settings = await gateway.setSpendLimits({ softLimitUsd: 80, hardLimitUsd: 100 }, { revision: settings.revision });
console.log((await gateway.teamSpend()).alerts);
await gateway.setContentCapture('redacted', { revision: settings.revision, workflow: 'ResearchWorkflow' });
Use update_team_settings / updateTeamSettings to combine other fields in the
same atomic change; reset_team_setting / resetTeamSetting restores policy.
Team and project reservations are checked atomically against the same monthly
counter across providers and tools. Editing a limit keeps the month's spend. Token
and request counters retain their configured SANDBOX_BUDGET_WINDOW_SECONDS.
The effective run ceiling is the lower of the worker's immutable requested budget
and the current workflow setting. Lowering a setting applies to an active run's next
call; raising it applies up to the worker's requested budget. Runs initialized by
older gateways retain any lower cap already stored for that run.
Approval settings govern the existing SDK ApprovalWorkflow review gate. A run
below the threshold, or with approval disabled, receives an audited automatic
decision there. Spend includes conservative reservations for unreported calls.
These settings apply to workflows that use the approval gate.
Since v0.9.0, all approval fields are saved with the run at launch; changing them
affects new runs. A retried start keeps its saved policy, while retrying a failed
run creates a new run using current settings. Existing gates from older releases retain
their one-reviewer/seven-day behavior. See approval policies
for upgrade order, reviewer identity and deadline semantics.
Routes, prices, credentials, model allowlists and egress stay in YAML, and alias selections apply within those controls; select a route the workflow already permits. Fallback, canary and shadow routes retain their normal admission checks. If an operator removes an overridden target from YAML, that alias fails closed until an admin selects a valid target or resets it.
API and conflicts¶
These three endpoints require a team-bound, unrestricted admin credential.
Other roles, and project-bound admins, receive 403 with detail.reason: team_role_required.
Read-only consumers use GET /v1/team and
GET /v1/workflow-policies.
GET /v1/team/settings returns the revision, update metadata, available route IDs
and a fields map. Each entry has value, source (policy or override) and
policy_default. For example, a budget field can be
"cost_limit_usd": {"value": 50, "source": "policy", "policy_default": 50}.
Send only edited fields in a PATCH, using the revision from GET in If-Match:
PATCH /v1/team/settings
If-Match: 0
Content-Type: application/json
{"fields":{"cost_limit_usd":100,"project_budgets.default":40,"workflows.ResearchWorkflow.approver_role":"admin","model_routes.research":"anthropic"}}
The names above are examples; use the field names and route IDs returned by your
gateway. Validation is atomic: 422 includes detail.fields entries with field
and message, and the patch is saved atomically. Malformed request bodies and
missing headers use the usual FastAPI validation locations. Fields, providers,
projects, workflows, aliases and routes must be ones the gateway returns.
DELETE /v1/team/settings/cost_limit_usd with If-Match: 1 resets just that field.
URL-encode the field name in reset requests. GET and successful writes also return
a quoted revision in ETag, which can be used as If-Match.
A stale revision returns 409 with detail.reason: team_settings_conflict for
PATCH and DELETE. Reload, review the current values, then reapply the intended
change. The console retains the unsaved draft until you choose Reload settings,
so you decide when to reapply a stale write. Leaving the page, reloading or switching
account with unsaved changes asks before discarding them. Cookie-authenticated writes also require
the normal CSRF token.
Every successful save/reset emits a hash-chained team_settings_changed audit
event with actor, revision and each touched field's before/after value and source.
Change events cover saved changes. Verify them with the existing
audit-chain runbook.