Skip to main content

Overview

Guardrail Policies endpoints

Available Operations

listAccountPolicies

List the workspace-wide policies that apply across workspaces in the account. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<operations.ListAccountPoliciesResponse>

Errors

createAccountPolicy

Create a workspace-wide budget, moderation, or model availability policy. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.AccountGuardrailPolicyResponse>

Errors

deleteAccountPolicy

Delete a workspace-wide policy. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.DeleteGuardrailPolicyResponse>

Errors

updateAccountPolicy

Replace a workspace-wide policy and its workspace coverage. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.AccountGuardrailPolicyResponse>

Errors

getApiKeyPolicyAssignment

Get the policies of one type that apply to an API key in a workspace. Requires a management key with write access. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.GuardrailPolicyAssignmentResponse>

Errors

changeApiKeyPolicyAssignment

Assign or unassign one policy for an API key. Fails with 409 when expected_assignment no longer matches the stored state. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ChangeGuardrailPolicyAssignmentResponse>

Errors

getMemberPolicyAssignment

Get the policies of one type that apply to a member in a workspace. Requires a management key with write access. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.GuardrailPolicyAssignmentResponse>

Errors

changeMemberPolicyAssignment

Assign or unassign one policy for a member. Fails with 409 when expected_assignment no longer matches the stored state. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ChangeGuardrailPolicyAssignmentResponse>

Errors

listScimGroupPolicyAssignments

List the guardrail policies attached to each SCIM group mapping in the organization. Requires scim:view and guardrails:view. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ListScimGroupPolicyAssignmentsResponse>

Errors

getScimGroupPolicyAssignment

Get the guardrail policies attached to one SCIM group mapping. Requires scim:view and guardrails:view. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ScimGroupPolicyAssignmentResponse>

Errors

updateScimGroupPolicyAssignment

Attach or remove guardrail policies on one SCIM group mapping, then update its members’ policies. Every type in the request is applied, or none is. Requires scim:view, guardrails:view and guardrails:update. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ScimGroupPolicyAssignmentResponse>

Errors

deleteScimGroupPolicyOptOut

Remove a member’s opt-out for one policy type, so the member receives their groups’ policy again right away. The member must be in the mapping’s group and the mapping must set a policy of that type. Requires scim:view, guardrails:view and guardrails:update. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.DeleteScimGroupOptOutResponse>

Errors

listScimGroupPolicyOptOuts

List the group’s members who opted out of a guardrail policy this mapping sets, per policy type. Opted-out members keep their own assignment (or none) instead of the group policy. Requires scim:view and guardrails:view. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ListScimGroupOptOutsResponse>

Errors

listBudgetPolicies

List the budget policies in a workspace. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<operations.ListBudgetPoliciesResponse>

Errors

createBudgetPolicy

Create a budget policy in a workspace. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.BudgetGuardrailPolicyResponse>

Errors

deleteBudgetPolicy

Delete a budget policy. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.DeleteGuardrailPolicyResponse>

Errors

getBudgetPolicy

Get a budget policy with its member and API key assignments. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.BudgetGuardrailPolicyDetailResponse>

Errors

updateBudgetPolicy

Replace a budget policy’s name and config, and optionally its assignments. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.BudgetGuardrailPolicyResponse>

Errors

listCapacityPolicies

List the capacity policies in a workspace. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<operations.ListCapacityPoliciesResponse>

Errors

createCapacityPolicy

Create a capacity policy in a workspace. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.CapacityGuardrailPolicyResponse>

Errors

deleteCapacityPolicy

Delete a capacity policy. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.DeleteGuardrailPolicyResponse>

Errors

getCapacityPolicy

Get a capacity policy with its member and API key assignments. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.CapacityGuardrailPolicyDetailResponse>

Errors

updateCapacityPolicy

Replace a capacity policy’s name and config, and optionally its assignments. Enterprise private beta feature. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.CapacityGuardrailPolicyResponse>

Errors

listModelAvailabilityPolicies

List the model availability policies in a workspace. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<operations.ListModelAvailabilityPoliciesResponse>

Errors

createModelAvailabilityPolicy

Create a model availability policy in a workspace. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ModelAvailabilityGuardrailPolicyResponse>

Errors

deleteModelAvailabilityPolicy

Delete a model availability policy. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.DeleteGuardrailPolicyResponse>

Errors

getModelAvailabilityPolicy

Get a model availability policy with its member and API key assignments. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ModelAvailabilityGuardrailPolicyDetailResponse>

Errors

updateModelAvailabilityPolicy

Replace a model availability policy’s name and config, and optionally its assignments. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ModelAvailabilityGuardrailPolicyResponse>

Errors

listModerationPolicies

List the moderation policies in a workspace. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<operations.ListModerationPoliciesResponse>

Errors

createModerationPolicy

Create a moderation policy in a workspace. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ModerationGuardrailPolicyResponse>

Errors

deleteModerationPolicy

Delete a moderation policy. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.DeleteGuardrailPolicyResponse>

Errors

getModerationPolicy

Get a moderation policy with its member and API key assignments. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ModerationGuardrailPolicyDetailResponse>

Errors

updateModerationPolicy

Replace a moderation policy’s name and config, and optionally its assignments. Management key required.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.ModerationGuardrailPolicyResponse>

Errors