Guardrail Policies
Create a workspace-wide policy
Changed onCreate a workspace-wide budget, moderation, or model availability policy. Management key required.
post/guardrails/policies/account
Request
- Base URLhttps://openrouter.ai/api/v1
- AuthHTTP bearer
Request body
union required
Budget Account Guardrail Policy Request required
OR
Moderation Account Guardrail Policy Request required
OR
Model Availability Account Guardrail Policy Request required
Example request
{
"config": {
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
},
"name": "Engineering monthly budget",
"policy_type": "budget",
"workspace_ids": [
"0df9e665-d932-5740-b2c7-b52af166bc11"
]
}Response
Workspace-wide policy created
Account Guardrail Policy Response required
data, union required
Example response
{
"data": {
"config": {
"include_byok_in_budgets": false,
"limit_usd": 200,
"reset_interval": "monthly"
},
"created_at": "2025-08-24T10:30:00Z",
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Engineering monthly budget",
"opted_out_workspace_ids": [
"0df9e665-d932-5740-b2c7-b52af166bc11"
],
"workspace_ids": [
"0df9e665-d932-5740-b2c7-b52af166bc11"
]
}
}Changes
- info
added the new optional request property
oneOf[#/components/schemas/ModelAvailabilityAccountGuardrailPolicyRequest]/config/allow_safety_retention_openai - info
added the optional property
data/oneOf[#/components/schemas/ModelAvailabilityAccountGuardrailPolicy]/config/allow_safety_retention_openaito the response with the status
- info
- info
added the new optional request property
oneOf[#/components/schemas/ModelAvailabilityAccountGuardrailPolicyRequest]/config/allow_provisional_providers
1 more change in this revision
- info