---
title: "Search gateway policies by subject value set"
method: POST
path: "/api/v1/platform/gateway-policies/search"
tags: ["gateway-policies"]
---

# Search gateway policies by subject value set

`POST /api/v1/platform/gateway-policies/search`

## Request

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

Batch variant of GET /v1/platform/gateway-policies for
fetching policies that match a set of subject_matcher_values
under one subject_matcher_key. Accepts the values in a JSON
body so callers can include hundreds of subject ids without
bumping into per-server URL-length limits.

Visibility, response shape, and matcher semantics are
identical to the GET list. With `subject_matcher_values`
empty (or omitted) this returns the same result as GET
with only `policy_type` set.

## Request body

- GatewayPoliciesSearchGatewayPoliciesRequest
  - `policy_type` string
  - `subject_matcher_key` string
  - `subject_matcher_values` string[]

## Response `200`

OK

- GatewayPoliciesGatewayPolicyRecord[]
  - `action` string
  - `config` object
  - `created_at` string
  - `created_by` string
  - `current_spend` GatewayPoliciesSpendUsage[]: CurrentSpend is the list of spends recorded for each of the tracked spend limit windows, used in v2 of spend_cap policy type.
    - `spend_usd` number: SpendUSD is the spend recorded in this window.
    - `window` string: Window is the spend limit period.
  - `current_spend_usd` number: 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.
  - `current_usage` GatewayPoliciesRateLimitUsage[]: CurrentUsage is the consumed units in each configured limit's current window. Set for any rate_limit policy regardless of enabled state, one entry per limit in the config. Nil for non-rate_limit policies or when the usage lookup failed.
    - `metric` 'requests' | 'tokens'
    - `value` integer: Value is the units consumed so far in the current window.
    - `window` 'minute' | 'hour'
  - `description` string
  - `enabled` boolean
  - `id` string
  - `is_system_generated` boolean
  - `name` string
  - `organization_id` string
  - `parent_policy_id` string: 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_type` string
  - `priority` integer
  - `subject_matchers` GatewayPoliciesSubjectMatcher[]
    - `key` string
    - `value` string
  - `updated_at` string

## Other responses

- `400`: validation error
- `401`: Unauthorized
- `403`: LLM Gateway not enabled, or caller lacks OrganizationRead
- `500`: Internal Server Error

## Changes

- **2026-10-16** `1a8ee9358d81`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langchain-ai/apis/langsmith/changes/api/v1/platform/gateway-policies/search/post.md)

---

[API](https://skmtc.dev/langchain-ai/apis/langsmith.md) - [All operations](https://skmtc.dev/langchain-ai/apis/langsmith/llms.txt) - [OpenAPI document](https://skmtc.dev/langchain-ai/apis/langsmith/revisions/28621d1a347a?raw)
