Overview
Guardrails endpointsAvailable Operations
- List - List guardrails
- Create - Create a guardrail
- Delete - Delete a guardrail
- Get - Get a guardrail
- Update - Update a guardrail
- ListGuardrailKeyAssignments - List key assignments for a guardrail
- BulkAssignKeys - Bulk assign keys to a guardrail
- BulkUnassignKeys - Bulk unassign keys from a guardrail
- ListGuardrailMemberAssignments - List member assignments for a guardrail
- BulkAssignMembers - Bulk assign members to a guardrail
- BulkUnassignMembers - Bulk unassign members from a guardrail
- ListKeyAssignments - List all key assignments
- ListMemberAssignments - List all member assignments
List
List all guardrails for the authenticated user. A workspace-scoped management key lists only its own workspace, whichworkspace_id defaults to; naming another workspace returns 403. Management key required.
Example Usage
Parameters
Response
*operations.ListGuardrailsResponse, errorErrors
Create
Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members;workspace_id places the guardrail in a workspace but does not apply it to that workspace’s traffic. To restrict all traffic in a workspace, update the workspace’s default guardrail instead. Set allowed_data_regions to enforce In-Region Routing: governed requests must arrive through one of the listed OpenRouter domains and are rejected with a 403 otherwise. A workspace-scoped management key creates in its own workspace, which workspace_id defaults to; naming another workspace returns 403. Management key required.
Example Usage
Parameters
Response
*components.CreateGuardrailResponse, errorErrors
Delete
Delete an existing guardrail. A workspace-scoped management key reaches only guardrails in its own workspace; any other guardrail returns 404. Management key required.Example Usage
Parameters
Response
*components.DeleteGuardrailResponse, errorErrors
Get
Get a single guardrail by ID. A workspace-scoped management key reaches only guardrails in its own workspace; any other guardrail returns 404. Management key required.Example Usage
Parameters
Response
*components.GetGuardrailResponse, errorErrors
Update
Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. A workspace-scoped management key reaches only guardrails in its own workspace; any other guardrail returns 404. Management key required.Example Usage
Parameters
Response
*components.UpdateGuardrailResponse, errorErrors
ListGuardrailKeyAssignments
List all API key assignments for a specific guardrail. A workspace-scoped management key reaches only guardrails in its own workspace; any other guardrail returns 404. Management key required.Example Usage
Parameters
Response
*operations.ListGuardrailKeyAssignmentsResponse, errorErrors
BulkAssignKeys
Assign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. A workspace-scoped management key reaches only guardrails in its own workspace (any other returns 404), and a batch naming an unknown or out-of-workspace key hash is rejected with 400 before anything changes. Management key required.Example Usage
Parameters
Response
*components.BulkAssignKeysResponse, errorErrors
BulkUnassignKeys
Unassign multiple API keys from a specific guardrail. A workspace-scoped management key reaches only guardrails in its own workspace (any other returns 404), and a batch naming an unknown or out-of-workspace key hash is rejected with 400 before anything changes. Management key required.Example Usage
Parameters
Response
*components.BulkUnassignKeysResponse, errorErrors
ListGuardrailMemberAssignments
List all organization member assignments for a specific guardrail. A workspace-scoped management key reaches only guardrails in its own workspace; any other guardrail returns 404. Management key required.Example Usage
Parameters
Response
*operations.ListGuardrailMemberAssignmentsResponse, errorErrors
BulkAssignMembers
Assign multiple organization members to a specific guardrail. Requires an organization-scoped management key; workspace-scoped management keys return 403. Management key required.Example Usage
Parameters
Response
*components.BulkAssignMembersResponse, errorErrors
BulkUnassignMembers
Unassign multiple organization members from a specific guardrail. Requires an organization-scoped management key; workspace-scoped management keys return 403. Management key required.Example Usage
Parameters
Response
*components.BulkUnassignMembersResponse, errorErrors
ListKeyAssignments
List all API key guardrail assignments for the authenticated user. A workspace-scoped management key lists only its own workspace, whichworkspace_id defaults to; naming another workspace returns 403. Management key required.
Example Usage
Parameters
Response
*operations.ListKeyAssignmentsResponse, errorErrors
ListMemberAssignments
List all organization member guardrail assignments for the authenticated user. A workspace-scoped management key lists only its own workspace, whichworkspace_id defaults to; naming another workspace returns 403. Management key required.