Org Settings
GET /api/orgs/{org_id}/model-config
Section titled “GET /api/orgs/{org_id}/model-config”Get Model Config
Return the org’s model policy (allowlists + defaults) per scope.
Readable by any org member — it drives client-side model-picker filtering and default selection. The real enforcement is server-side (agent CRUD + chat send), so this endpoint carries no secrets and no budget data.
disabled_providers reports the toggles as the server will apply them,
which for an org without byo_keys is none at all: the toggle governs a
provider that org does not own and is skipped at
ensure_model_allowed_for_org step 5. Reporting a stored-but-inert value
would grey out models the picker would then have accepted — a hint that
disagrees with the gate is worse than no hint, because the disagreement only
shows up as models mysteriously missing.
model_routes is this org’s answer to “where does each model’s calls go
and whose key pays” — populated only when the org holds byo_keys, null
otherwise. This is the surface CatalogModel (GET /api/models/catalog)
names as the intended home for that information, because that endpoint is
platform-wide and has no entitlement to check; this one is org-scoped and
does.
Requires membership.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | ModelConfigResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/{org_id}/settings/ai
Section titled “GET /api/orgs/{org_id}/settings/ai”Get Ai Settings
Get AI provider settings for the organization (secrets redacted).
Requires ADMIN or OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | AIProviderSettingsResponse |
| 422 | Validation Error | HTTPValidationError |
PATCH /api/orgs/{org_id}/settings/ai
Section titled “PATCH /api/orgs/{org_id}/settings/ai”Update Ai Settings
Update AI provider settings for the organization.
Requires ADMIN or OWNER role. Only fields present in the request body are updated; omitted fields are left unchanged.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| ai_gateway_account_id | string | no | |
| ai_gateway_gateway_id | string | no | |
| ai_gateway_log_payloads | string | no | |
| ai_gateway_mode | "" | "custom" | "off" | no | |
| ai_gateway_token | string | no | |
| anthropic_api_key | string | no | |
| anthropic_base_url | string | no | |
| anthropic_credential_source | "" | "api_key" | "cloudflare" | no | |
| anthropic_enabled | "" | "true" | "false" | no | |
| openai_api_key | string | no | |
| openai_base_url | string | no | |
| openai_credential_source | "" | "api_key" | "cloudflare" | no | |
| openai_enabled | "" | "true" | "false" | no |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | AIProviderSettingsResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/{org_id}/settings/ai/routes
Section titled “GET /api/orgs/{org_id}/settings/ai/routes”Get Route Settings
Every inference route with this org’s per-route credentials (secrets masked).
One row per route the platform defines, including routes the org has never configured and routes the platform has disabled — an org cannot invent a route, so the platform’s list is the whole list, and an omitted row would read as “no such route” rather than “not configured”.
Requires ADMIN or OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgRouteSettingsResponse |
| 422 | Validation Error | HTTPValidationError |
PATCH /api/orgs/{org_id}/settings/ai/routes
Section titled “PATCH /api/orgs/{org_id}/settings/ai/routes”Update Route Settings
Set this org’s credentials, endpoint override and toggle for one or more routes.
Only routes present in the body are touched, and within a route only the
fields present. An explicit null clears a field; clearing is allowed on
every plan, so a downgrade never strands a value the org can no longer
remove.
Two refusals are specific to this endpoint, and both would otherwise store a value nothing reads:
- A slug that is not a live route answers 422 naming it, and nothing at all is persisted. It is not silently dropped — the org settings store skips keys it does not recognise and returns 200, which for a mistyped route would mean an admin watching a key “save” that was never stored. An unreadable route table produces an empty list and therefore refuses every write, which is the safe direction: refusing a legitimate save is visible, accepting an illegitimate one is not.
- A route that spends another route’s key (
credential_routeset) refusesapi_keyandcredential_source.anthropic-cfsendsanthropic-direct’s credential by design; a key stored on the-cfrow would be silently unread, and an admin would reasonably conclude the gateway was configured.
Requires ADMIN or OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| routes | object | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgRouteSettingsResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/{org_id}/settings/limits
Section titled “GET /api/orgs/{org_id}/settings/limits”Get Org Limits
Get model governance (two allowlists + defaults) and budget for the org.
Reads every stored value back unfiltered, including one the org’s current
plan would now refuse on PATCH and one the runtime no longer enforces.
That is deliberate and load-bearing: a value that still exists on the account
has to stay visible to the admin who set it, or gating the write just
recreates the invisible-setting problem the gate exists to remove — this time
with the value hidden instead of merely unexplained. Enforcement and display
are separate questions.
Requires ADMIN or OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgLimitsResponse |
| 422 | Validation Error | HTTPValidationError |
PATCH /api/orgs/{org_id}/settings/limits
Section titled “PATCH /api/orgs/{org_id}/settings/limits”Update Org Limits
Update the org’s two model allowlists, default models, and/or budget.
Only fields present in the request body are updated; omitted fields are left
unchanged. For default-model fields, an explicit null clears the default.
Invariant: when a scope’s allowlist is non-empty, its default model must be
set and within the allowlist (422 otherwise). Response affected_agents
lists agents left outside the (new) agent allowlist — they downgrade to the
agent default at run time.
Two groups of fields here are plan-gated and answer 403 when set (never when
cleared): the model controls need direct_model_choice, and
budget_limit_usd is refused to an org whose plan enforces_credits.
See :data:MODEL_CHOICE_LIMIT_KEYS and the guard below.
Requires ADMIN or OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| agent_default_model | DefaultModel | no | |
| agent_model_allowlist | string[] | no | |
| budget_limit_usd | string | no | |
| chat_default_model | DefaultModel | no | |
| chat_model_allowlist | string[] | no | |
| intake_classifier_default_model | DefaultModel | no | |
| process_default_model | DefaultModel | no | |
| prompt_model_allowlist | string[] | no | |
| tool_router_default_model | ToolRouterDefaultModel | no |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgLimitsResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/{org_id}/settings/limits/usage
Section titled “GET /api/orgs/{org_id}/settings/limits/usage”Get Org Limits Usage
Get the org’s current spend vs. its configured budget cap.
Returns two spend figures (M11 — see OrgLimitsUsageResponse): the
chat-attributed total the budget cap enforces against (spend_usd) and
the fuller metered total including chat-less LLM calls
(metered_spend_usd), so the two no longer read as unlabelled
disagreeing numbers. Useful for the admin limits panel.
budget_limit_usd is reported as stored even for an org whose plan
enforces_credits and for which the runner therefore no longer reads it —
same reason as GET /settings/limits: a stored value stays visible to
whoever set it.
Requires ADMIN or OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgLimitsUsageResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/{org_id}/settings/runtime
Section titled “GET /api/orgs/{org_id}/settings/runtime”Get Runtime Settings
Get the org’s AI runtime overrides (compaction + model thinking).
A null field means the org inherits; platform_defaults says what that
inheritance currently resolves to.
Requires ADMIN or OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgRuntimeSettingsResponse |
| 422 | Validation Error | HTTPValidationError |
PATCH /api/orgs/{org_id}/settings/runtime
Section titled “PATCH /api/orgs/{org_id}/settings/runtime”Update Runtime Settings
Set (or clear) the org’s AI runtime overrides.
Omitted fields are left unchanged; an explicit null drops the override
so the setting falls back to the platform tier. Values are re-read at the
start of every run, so a change here lands on the next turn.
thinking_enabled needs direct_model_choice: on a plan that sells
effort modes, the preset carries thinking, effort and model together, and
the runtime half drops any stored value
(:data:~agentdepot_core.services.model_policy.MODE_OWNED_RUNTIME_KEYS).
Requires ADMIN or OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| compaction_enabled | boolean | no | |
| compaction_threshold | number | no | |
| thinking_enabled | boolean | no |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgRuntimeSettingsResponse |
| 422 | Validation Error | HTTPValidationError |