Guardrail Policies
Get an API key policy assignment
Changed onGet the policies of one type that apply to an API key in a workspace. Requires a management key with write access. Management key required.
get/guardrails/policies/assignments/api-keys/{hash}
Request
- Base URLhttps://openrouter.ai/api/v1
- AuthHTTP bearer
Path parameters
hash, string required
API key hash
Example:c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
Query parameters
workspace_id, string uuid
Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.
Example:0df9e665-d932-5740-b2c7-b52af166bc11
policy_type, 'budget' | 'model_availability' | 'moderation' | 'rate_limit' required
Policy type the assignment is read or changed for
Example:budget
Response
Assignment state
Guardrail Policy Assignment Response required
data, Guardrail Policy Assignment State required
Example response
{
"data": {
"policy_ids": [],
"workspace_default_policy_ids": [
"2c6f1a4e-0b7d-4e59-9a61-3f8d2e7c1b90"
]
}
}Changes
- info
the
queryrequest parameterworkspace_idbecame optional
- info
- info
endpoint added
- info