gateway-policies

List gateway policies

Changed on

Returns every gateway policy in the current organization. The response includes both admin-created policies and runtime-materialized children of default_spend_cap and default_rate_limit policies (children carry parent_policy_id).

Spend tracking: each spend-cap policy carries current_spend_usd — the spend accumulated in the policy's active window.

Filters (all optional):

  • policy_type — spend_cap, default_spend_cap, guard, route_config, model_fallback, rate_limit, or default_rate_limit
  • subject_matcher_key + subject_matcher_value — narrow to policies whose subject_matchers contain {key, value}

For batch lookups by a set of subject values (e.g. many run_rule_ids at once), use POST /v1/platform/gateway-policies/search; it accepts the values in a JSON body and avoids the URL-length ceiling that a repeated query param would hit at scale.

get/api/v1/platform/gateway-policies

Request

  • Base URL
    https://api.smith.langchain.com
  • URL
    https://api.smith.langchain.com/api/v1/platform/gateway-policies
  • Auth
    • API key in header X-API-Key
    • or HTTP bearer

Query parameters

policy_typestring

Filter by policy_type

subject_matcher_keystring

Filter by subject matcher key

subject_matcher_valuestring

Filter by subject matcher value (paired with subject_matcher_key)

Response

OK

actionstring
configobject
created_atstring
created_bystring
current_spend_usdnumber

CurrentSpendUSD is the spend in the policy's current window. Set for any spend_cap policy regardless of enabled state — disabled policies still surface usage so users can see what would have been counted. Nil for non-spend_cap policies or when the spend lookup failed.

descriptionstring
enabledboolean
idstring
is_system_generatedboolean
namestring
organization_idstring
parent_policy_idstring

ParentPolicyID is set on materialized children of a default_spend_cap to the default's id. An explicit Update or a Create with the same matchers clears the link and takes ownership of the materialized row. Delete on the parent cascade-soft-deletes children still attached.

policy_typestring
priorityinteger
updated_atstring

Changes