Guardrails
Bulk assign keys to a guardrail
Changed onAssign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. Management key required.
post/guardrails/{id}/assignments/keys
Request
- Base URL: https://openrouter.ai/api/v1
- URL: https://openrouter.ai/api/v1/guardrails/{id}/assignments/keys
- Auth: HTTP bearer
Path parameters
idstring uuid required
The unique identifier of the guardrail
Example:550e8400-e29b-41d4-a716-446655440000
Request body
Example request
{
"key_hashes": [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
]
}Response
Assignment result
Example response
{
"assigned_count": 3
}Changes
- info
added the non-success response with the status
- info