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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<operations.ListGuardrailsResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.CreateGuardrailResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.DeleteGuardrailResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.GetGuardrailResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.UpdateGuardrailResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<operations.ListGuardrailKeyAssignmentsResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.BulkAssignKeysResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.BulkUnassignKeysResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<operations.ListGuardrailMemberAssignmentsResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.BulkAssignMembersResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<models.BulkUnassignMembersResponse>Errors
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
Standalone function
The standalone function version of this method:Parameters
Response
Promise<operations.ListKeyAssignmentsResponse>Errors
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.