Skip to content

Org Settings

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

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseModelConfigResponse
422Validation ErrorHTTPValidationError

Get Ai Settings

Get AI provider settings for the organization (secrets redacted).

Requires ADMIN or OWNER role.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseAIProviderSettingsResponse
422Validation ErrorHTTPValidationError

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

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
ai_gateway_account_idstringno
ai_gateway_gateway_idstringno
ai_gateway_log_payloadsstringno
ai_gateway_mode"" | "custom" | "off"no
ai_gateway_tokenstringno
anthropic_api_keystringno
anthropic_base_urlstringno
anthropic_credential_source"" | "api_key" | "cloudflare"no
anthropic_enabled"" | "true" | "false"no
openai_api_keystringno
openai_base_urlstringno
openai_credential_source"" | "api_key" | "cloudflare"no
openai_enabled"" | "true" | "false"no

Responses

StatusDescriptionBody
200Successful ResponseAIProviderSettingsResponse
422Validation ErrorHTTPValidationError

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

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseOrgRouteSettingsResponse
422Validation ErrorHTTPValidationError

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_route set) refuses api_key and credential_source. anthropic-cf sends anthropic-direct’s credential by design; a key stored on the -cf row would be silently unread, and an admin would reasonably conclude the gateway was configured.

Requires ADMIN or OWNER role.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
routesobjectyes

Responses

StatusDescriptionBody
200Successful ResponseOrgRouteSettingsResponse
422Validation ErrorHTTPValidationError

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

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseOrgLimitsResponse
422Validation ErrorHTTPValidationError

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

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
agent_default_modelDefaultModelno
agent_model_allowliststring[]no
budget_limit_usdstringno
chat_default_modelDefaultModelno
chat_model_allowliststring[]no
intake_classifier_default_modelDefaultModelno
process_default_modelDefaultModelno
prompt_model_allowliststring[]no
tool_router_default_modelToolRouterDefaultModelno

Responses

StatusDescriptionBody
200Successful ResponseOrgLimitsResponse
422Validation ErrorHTTPValidationError

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

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseOrgLimitsUsageResponse
422Validation ErrorHTTPValidationError

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

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseOrgRuntimeSettingsResponse
422Validation ErrorHTTPValidationError

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

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
compaction_enabledbooleanno
compaction_thresholdnumberno
thinking_enabledbooleanno

Responses

StatusDescriptionBody
200Successful ResponseOrgRuntimeSettingsResponse
422Validation ErrorHTTPValidationError