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

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

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