diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 19ee4020..71794768 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -34,6 +34,35 @@ components: - 'coding_index' - 'agentic_index' type: 'object' + AccountGuardrailPolicy: + discriminator: + mapping: + budget: '#/components/schemas/BudgetAccountGuardrailPolicy' + model_availability: '#/components/schemas/ModelAvailabilityAccountGuardrailPolicy' + moderation: '#/components/schemas/ModerationAccountGuardrailPolicy' + propertyName: 'policy_type' + oneOf: + - $ref: '#/components/schemas/BudgetAccountGuardrailPolicy' + - $ref: '#/components/schemas/ModerationAccountGuardrailPolicy' + - $ref: '#/components/schemas/ModelAvailabilityAccountGuardrailPolicy' + AccountGuardrailPolicyRequest: + discriminator: + mapping: + budget: '#/components/schemas/BudgetAccountGuardrailPolicyRequest' + model_availability: '#/components/schemas/ModelAvailabilityAccountGuardrailPolicyRequest' + moderation: '#/components/schemas/ModerationAccountGuardrailPolicyRequest' + propertyName: 'policy_type' + oneOf: + - $ref: '#/components/schemas/BudgetAccountGuardrailPolicyRequest' + - $ref: '#/components/schemas/ModerationAccountGuardrailPolicyRequest' + - $ref: '#/components/schemas/ModelAvailabilityAccountGuardrailPolicyRequest' + AccountGuardrailPolicyResponse: + properties: + data: + $ref: '#/components/schemas/AccountGuardrailPolicy' + required: + - 'data' + type: 'object' ActivityItem: example: byok_usage_inference: 0.012 @@ -6652,6 +6681,344 @@ components: required: - 'type' type: 'object' + BudgetAccountGuardrailPolicy: + properties: + config: + $ref: '#/components/schemas/GuardrailBudgetPolicyConfig' + created_at: + example: '2025-08-24T10:30:00Z' + type: 'string' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_default: + type: 'boolean' + is_synced: + description: 'Kept in sync with a v1 guardrail; saving changes creates an account copy' + type: 'boolean' + is_workspace_default_synced: + description: 'Synced from a v1 workspace default guardrail' + type: 'boolean' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_workspace_ids: + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + policy_type: + enum: + - 'budget' + type: 'string' + updated_at: + type: + - 'string' + - 'null' + workspace_count: + minimum: 0 + type: 'integer' + workspace_ids: + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'created_at' + - 'updated_at' + - 'is_default' + - 'workspace_count' + - 'workspace_ids' + - 'opted_out_workspace_ids' + - 'is_synced' + - 'is_workspace_default_synced' + type: 'object' + BudgetAccountGuardrailPolicyRequest: + example: + config: + include_byok_in_budgets: false + limit_usd: 200 + reset_interval: 'monthly' + name: 'Engineering monthly budget' + policy_type: 'budget' + workspace_ids: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + properties: + config: + $ref: '#/components/schemas/GuardrailBudgetPolicyAuthoringConfig' + floor_reassignment: + description: 'Move workspaces off this policy onto another workspace-wide policy in the same write' + properties: + policy_id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + workspace_ids: + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + minItems: 1 + type: 'array' + required: + - 'policy_id' + - 'workspace_ids' + type: 'object' + is_default: + description: 'Cover every workspace in the account except `opted_out_workspace_ids`. On update, `false` on the current default unsets it.' + type: 'boolean' + keep_previous_default_workspaces: + description: 'Keep workspaces that inherited the replaced default on that policy. Cannot be combined with `released_floor_workspace_ids`.' + type: 'boolean' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_workspace_ids: + description: 'Workspaces left out of a default policy' + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + policy_type: + enum: + - 'budget' + type: 'string' + released_floor_workspace_ids: + description: 'Workspaces whose own workspace-wide policy of this type is dropped so they inherit this default' + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + workspace_ids: + description: 'Workspaces the policy covers when it is not the default' + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + required: + - 'name' + - 'policy_type' + - 'config' + type: 'object' + BudgetGuardrailPolicy: + properties: + config: + $ref: '#/components/schemas/GuardrailBudgetPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + policy_type: + enum: + - 'budget' + type: 'string' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + type: 'object' + BudgetGuardrailPolicyDetail: + properties: + api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailBudgetPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_workspace_default: + type: 'boolean' + member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + opted_out_member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + overridden_api_key_hashes: + description: 'API keys that have a different policy of this type assigned directly' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + overridden_member_ids: + description: 'Members that have a different policy of this type assigned directly' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + policy_type: + enum: + - 'budget' + type: 'string' + reference: + default: null + description: '`legacy_mapping` when the policy is synced from a v1 guardrail, `account_default` when it is an account-wide default, otherwise `null`' + enum: + - 'legacy_mapping' + - 'account_default' + - null + type: + - 'string' + - 'null' + replaces_legacy_default: + description: 'Whether this workspace copy replaced a v1 workspace default guardrail that still exists; it cannot be deleted' + type: 'boolean' + updated_at: + type: + - 'string' + - 'null' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'updated_at' + - 'member_ids' + - 'api_key_hashes' + - 'opted_out_api_key_hashes' + - 'overridden_api_key_hashes' + type: 'object' + BudgetGuardrailPolicyDetailResponse: + properties: + data: + $ref: '#/components/schemas/BudgetGuardrailPolicyDetail' + required: + - 'data' + type: 'object' + BudgetGuardrailPolicyResponse: + properties: + data: + $ref: '#/components/schemas/BudgetGuardrailPolicy' + required: + - 'data' + type: 'object' + BudgetGuardrailPolicySummary: + properties: + api_key_count: + minimum: 0 + type: 'integer' + config: + $ref: '#/components/schemas/GuardrailBudgetPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_legacy_mapped: + description: 'Whether the policy is kept in sync with a v1 guardrail' + type: 'boolean' + is_workspace_default: + type: 'boolean' + legacy_guardrail_ids: + description: 'IDs of the v1 guardrails this policy was migrated from' + items: + type: 'string' + type: 'array' + member_count: + minimum: 0 + type: 'integer' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + policy_type: + enum: + - 'budget' + type: 'string' + replaced_legacy_guardrail_ids: + description: 'IDs of the v1 guardrails this policy replaced' + items: + type: 'string' + type: 'array' + updated_at: + type: + - 'string' + - 'null' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'updated_at' + - 'member_count' + - 'api_key_count' + type: 'object' BulkAddWorkspaceMembersRequest: example: user_ids: @@ -7120,6 +7487,51 @@ components: - $ref: '#/components/schemas/EnumCapability' - $ref: '#/components/schemas/RangeCapability' - $ref: '#/components/schemas/BooleanCapability' + ChangeGuardrailPolicyAssignmentRequest: + properties: + assigned: + description: '`true` assigns the policy to the subject, `false` removes it' + example: true + type: 'boolean' + expected_assignment: + allOf: + - $ref: '#/components/schemas/GuardrailPolicyAssignmentState' + - description: 'The assignment state last read for the subject. The request fails with 409 if it changed since.' + policy_id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + policy_type: + description: 'Policy type the assignment is read or changed for' + enum: + - 'budget' + - 'model_availability' + - 'moderation' + - 'rate_limit' + example: 'budget' + type: 'string' + workspace_id: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + required: + - 'workspace_id' + - 'policy_type' + - 'policy_id' + - 'assigned' + - 'expected_assignment' + type: 'object' + ChangeGuardrailPolicyAssignmentResponse: + properties: + data: + description: 'Whether the assignment changed' + example: true + type: 'boolean' + required: + - 'data' + type: 'object' ChatAssistantImages: description: 'Generated images from image generation models' example: @@ -9814,6 +10226,70 @@ components: type: - 'object' - 'null' + CreateBudgetGuardrailPolicyRequest: + properties: + api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailBudgetPolicyAuthoringConfig' + is_workspace_default: + description: 'Make this the workspace default for its policy type. Defaults to `false`.' + type: 'boolean' + member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_api_key_hashes: + description: 'API keys that should not inherit the policy when it is the workspace default' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + opted_out_member_ids: + description: 'Members that should not inherit the policy when it is the workspace default' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + policy_type: + enum: + - 'budget' + type: 'string' + workspace_id: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + required: + - 'name' + - 'policy_type' + - 'config' + - 'workspace_id' + type: 'object' CreateBYOKKeyRequest: example: key: 'sk-proj-abc123...' @@ -10233,6 +10709,134 @@ components: required: - 'data' type: 'object' + CreateModelAvailabilityGuardrailPolicyRequest: + properties: + api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailModelAvailabilityPolicyAuthoringConfig' + is_workspace_default: + description: 'Make this the workspace default for its policy type. Defaults to `false`.' + type: 'boolean' + member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_api_key_hashes: + description: 'API keys that should not inherit the policy when it is the workspace default' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + opted_out_member_ids: + description: 'Members that should not inherit the policy when it is the workspace default' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + policy_type: + enum: + - 'model_availability' + type: 'string' + workspace_id: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + required: + - 'name' + - 'policy_type' + - 'config' + - 'workspace_id' + type: 'object' + CreateModerationGuardrailPolicyRequest: + properties: + api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailModerationPolicyConfig' + is_workspace_default: + description: 'Make this the workspace default for its policy type. Defaults to `false`.' + type: 'boolean' + member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_api_key_hashes: + description: 'API keys that should not inherit the policy when it is the workspace default' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + opted_out_member_ids: + description: 'Members that should not inherit the policy when it is the workspace default' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + policy_type: + enum: + - 'moderation' + type: 'string' + workspace_id: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + required: + - 'name' + - 'policy_type' + - 'config' + - 'workspace_id' + type: 'object' CreateObservabilityDestinationRequest: example: config: @@ -11535,6 +12139,15 @@ components: required: - 'deleted' type: 'object' + DeleteGuardrailPolicyResponse: + properties: + data: + description: 'Whether the policy was deleted' + example: true + type: 'boolean' + required: + - 'data' + type: 'object' DeleteGuardrailResponse: example: deleted: true @@ -15057,6 +15670,55 @@ components: - 'created_at' - 'workspace_id' type: 'object' + GuardrailBudgetPolicyAuthoringConfig: + additionalProperties: false + example: + include_byok_in_budgets: false + limit_usd: 200 + reset_interval: 'monthly' + properties: + include_byok_in_budgets: + type: 'boolean' + limit_usd: + exclusiveMinimum: 0 + minimum: 0 + type: + - 'number' + - 'null' + reset_interval: + enum: + - 'daily' + - 'weekly' + - 'monthly' + - null + type: + - 'string' + - 'null' + required: + - 'limit_usd' + - 'reset_interval' + - 'include_byok_in_budgets' + type: 'object' + GuardrailBudgetPolicyConfig: + example: + include_byok_in_budgets: false + limit_usd: 200 + reset_interval: 'monthly' + properties: + include_byok_in_budgets: + description: 'Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail''s limit_usd, in addition to OpenRouter credit spend. Defaults to false.' + example: false + type: 'boolean' + limit_usd: + description: 'Spending limit in USD. Must be provided together with `reset_interval`: a request that sets only one of the two is rejected with a 400.' + example: 50 + format: 'double' + type: + - 'number' + - 'null' + reset_interval: + $ref: '#/components/schemas/GuardrailInterval' + type: 'object' GuardrailDataRegion: description: 'An OpenRouter data region: `global` (https://openrouter.ai), `europe` (https://eu.openrouter.ai), or `us` (https://us.openrouter.ai)' enum: @@ -15076,6 +15738,433 @@ components: type: - 'string' - 'null' + GuardrailModelAvailabilityPolicyAuthoringConfig: + additionalProperties: false + example: + allowed_models: + - 'openai/gpt-4o' + - 'anthropic/claude-sonnet-4' + allowed_providers: + - 'openai' + - 'anthropic' + enforce_zdr_anthropic: true + enforce_zdr_openai: true + properties: + allow_safety_retention_google: + type: + - 'boolean' + - 'null' + allow_safety_retention_other: + type: + - 'boolean' + - 'null' + allowed_data_regions: + items: + type: 'string' + minItems: 1 + type: + - 'array' + - 'null' + allowed_models: + items: + type: 'string' + type: + - 'array' + - 'null' + allowed_providers: + items: + type: 'string' + type: + - 'array' + - 'null' + enable_free_model_publication: + type: + - 'boolean' + - 'null' + enable_free_model_training: + type: + - 'boolean' + - 'null' + enable_paid_model_training: + type: + - 'boolean' + - 'null' + enforce_first_party_harness_models: + type: + - 'boolean' + - 'null' + enforce_zdr: + type: + - 'boolean' + - 'null' + enforce_zdr_anthropic: + type: + - 'boolean' + - 'null' + enforce_zdr_google: + type: + - 'boolean' + - 'null' + enforce_zdr_openai: + type: + - 'boolean' + - 'null' + enforce_zdr_other: + type: + - 'boolean' + - 'null' + enforce_zdr_xai: + type: + - 'boolean' + - 'null' + ignored_models: + items: + type: 'string' + type: + - 'array' + - 'null' + ignored_providers: + items: + type: 'string' + type: + - 'array' + - 'null' + platform_banned_authors: + items: + type: 'string' + type: + - 'array' + - 'null' + platform_banned_models: + items: + type: 'string' + type: + - 'array' + - 'null' + platform_banned_providers: + items: + type: 'string' + type: + - 'array' + - 'null' + require_eu_data_region: + type: + - 'boolean' + - 'null' + type: 'object' + GuardrailModelAvailabilityPolicyConfig: + additionalProperties: false + example: + allowed_models: + - 'openai/gpt-4o' + - 'anthropic/claude-sonnet-4' + allowed_providers: + - 'openai' + - 'anthropic' + enforce_zdr_anthropic: true + enforce_zdr_openai: true + properties: + allow_safety_retention_google: + type: + - 'boolean' + - 'null' + allow_safety_retention_other: + type: + - 'boolean' + - 'null' + allowed_data_regions: + items: + type: 'string' + type: + - 'array' + - 'null' + allowed_models: + items: + type: 'string' + type: + - 'array' + - 'null' + allowed_providers: + items: + type: 'string' + type: + - 'array' + - 'null' + enable_free_model_publication: + type: + - 'boolean' + - 'null' + enable_free_model_training: + type: + - 'boolean' + - 'null' + enable_paid_model_training: + type: + - 'boolean' + - 'null' + enforce_first_party_harness_models: + type: + - 'boolean' + - 'null' + enforce_zdr: + type: + - 'boolean' + - 'null' + enforce_zdr_anthropic: + type: + - 'boolean' + - 'null' + enforce_zdr_google: + type: + - 'boolean' + - 'null' + enforce_zdr_openai: + type: + - 'boolean' + - 'null' + enforce_zdr_other: + type: + - 'boolean' + - 'null' + enforce_zdr_xai: + type: + - 'boolean' + - 'null' + ignored_models: + items: + type: 'string' + type: + - 'array' + - 'null' + ignored_providers: + items: + type: 'string' + type: + - 'array' + - 'null' + platform_banned_authors: + items: + type: 'string' + type: + - 'array' + - 'null' + platform_banned_models: + items: + type: 'string' + type: + - 'array' + - 'null' + platform_banned_providers: + items: + type: 'string' + type: + - 'array' + - 'null' + require_eu_data_region: + type: + - 'boolean' + - 'null' + type: 'object' + GuardrailModerationPolicyConfig: + additionalProperties: false + example: + content_filter_builtins: + - action: 'block' + slug: 'secrets' + properties: + armor: + additionalProperties: false + properties: + classifier_context: + $ref: '#/components/schemas/ArmorContext' + mode: + description: '`enforce` withholds blocked calls; `audit` evaluates and reports the same verdicts without withholding any calls, regardless of `on_error`. Default `enforce`.' + enum: + - 'enforce' + - 'audit' + type: 'string' + on_error: + description: 'When the classifier cannot answer (timeout, upstream error, context too long) the call is reported `unavailable`; `block` rejects it and `log` releases it. Default `block`.' + enum: + - 'log' + - 'block' + type: 'string' + use_cc_style_default_rules: + description: 'Prepend Claude Code''s built-in auto-mode rule set (1 hard-deny, 72 soft-deny, 17 allow, 21 environment slots) ahead of every configured rule. Defaults to true on the Anthropic Messages API and false elsewhere.' + type: 'boolean' + type: + - 'object' + - 'null' + broadcast_model_armor_flagged_requests: + type: + - 'boolean' + - 'null' + content_filter_blocks_requests: + type: 'boolean' + content_filter_builtins: + items: + additionalProperties: false + properties: + action: + enum: + - 'redact' + - 'block' + - 'flag' + type: 'string' + label: + maxLength: 100 + type: 'string' + scan_scope: + enum: + - 'user_only' + - 'all_messages' + type: 'string' + slug: + enum: + - 'email' + - 'phone' + - 'ssn' + - 'credit-card' + - 'ip-address' + - 'secrets' + - 'person-name' + - 'address' + - 'regex-prompt-injection' + type: 'string' + required: + - 'slug' + - 'action' + type: 'object' + type: + - 'array' + - 'null' + content_filter_patterns: + items: + type: 'string' + type: + - 'array' + - 'null' + content_filters: + items: + additionalProperties: false + properties: + action: + enum: + - 'redact' + - 'block' + - 'flag' + type: 'string' + label: + maxLength: 100 + type: + - 'string' + - 'null' + pattern: + maxLength: 100000 + minLength: 1 + type: 'string' + required: + - 'pattern' + - 'action' + type: 'object' + type: + - 'array' + - 'null' + enable_model_armor_injection_protection: + type: + - 'boolean' + - 'null' + lakera_injection_protection_mode: + enum: + - 'block' + - 'flag' + - null + type: + - 'string' + - 'null' + model_armor_injection_confidence_level: + enum: + - 'low' + - 'medium' + - 'high' + type: 'string' + model_armor_injection_protection_mode: + enum: + - 'block' + - 'flag' + - null + type: + - 'string' + - 'null' + pii_filters: + items: + additionalProperties: false + properties: + action: + enum: + - 'redact' + - 'block' + - 'flag' + type: 'string' + entity_type: + type: 'string' + score_threshold: + maximum: 1 + minimum: 0 + type: 'number' + required: + - 'entity_type' + - 'action' + type: 'object' + type: + - 'array' + - 'null' + platform_image_moderated_providers: + items: + type: 'string' + type: + - 'array' + - 'null' + platform_moderated_providers: + items: + type: 'string' + type: + - 'array' + - 'null' + type: 'object' + GuardrailPolicyAssignmentResponse: + properties: + data: + $ref: '#/components/schemas/GuardrailPolicyAssignmentState' + required: + - 'data' + type: 'object' + GuardrailPolicyAssignmentState: + properties: + opted_out: + description: 'Whether the subject is opted out of the workspace default' + example: false + type: 'boolean' + policy_ids: + description: 'Policies of this type assigned directly to the subject' + example: [] + items: + format: 'uuid' + type: 'string' + type: 'array' + workspace_default_policy_ids: + description: 'Workspace default policies of this type the subject inherits' + example: + - '2c6f1a4e-0b7d-4e59-9a61-3f8d2e7c1b90' + items: + format: 'uuid' + type: 'string' + type: 'array' + required: + - 'policy_ids' + - 'workspace_default_policy_ids' + - 'opted_out' + type: 'object' ImageConfig: additionalProperties: anyOf: @@ -16782,6 +17871,36 @@ components: required: - 'type' type: 'object' + ListAccountGuardrailPoliciesResponse: + properties: + data: + items: + $ref: '#/components/schemas/AccountGuardrailPolicy' + type: 'array' + total_count: + description: 'Total number of policies' + example: 1 + minimum: 0 + type: 'integer' + required: + - 'data' + - 'total_count' + type: 'object' + ListBudgetGuardrailPoliciesResponse: + properties: + data: + items: + $ref: '#/components/schemas/BudgetGuardrailPolicySummary' + type: 'array' + total_count: + description: 'Total number of policies' + example: 1 + minimum: 0 + type: 'integer' + required: + - 'data' + - 'total_count' + type: 'object' ListBYOKKeysResponse: example: data: @@ -17048,6 +18167,36 @@ components: - 'data' - 'total_count' type: 'object' + ListModelAvailabilityGuardrailPoliciesResponse: + properties: + data: + items: + $ref: '#/components/schemas/ModelAvailabilityGuardrailPolicySummary' + type: 'array' + total_count: + description: 'Total number of policies' + example: 1 + minimum: 0 + type: 'integer' + required: + - 'data' + - 'total_count' + type: 'object' + ListModerationGuardrailPoliciesResponse: + properties: + data: + items: + $ref: '#/components/schemas/ModerationGuardrailPolicySummary' + type: 'array' + total_count: + description: 'Total number of policies' + example: 1 + minimum: 0 + type: 'integer' + required: + - 'data' + - 'total_count' + type: 'object' ListObservabilityDestinationsResponse: example: data: @@ -20010,6 +21159,349 @@ components: - 'input_modalities' - 'output_modalities' type: 'object' + ModelAvailabilityAccountGuardrailPolicy: + properties: + config: + $ref: '#/components/schemas/GuardrailModelAvailabilityPolicyConfig' + created_at: + example: '2025-08-24T10:30:00Z' + type: 'string' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_default: + type: 'boolean' + is_synced: + description: 'Kept in sync with a v1 guardrail; saving changes creates an account copy' + type: 'boolean' + is_workspace_default_synced: + description: 'Synced from a v1 workspace default guardrail' + type: 'boolean' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_workspace_ids: + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + policy_type: + enum: + - 'model_availability' + type: 'string' + updated_at: + type: + - 'string' + - 'null' + workspace_count: + minimum: 0 + type: 'integer' + workspace_ids: + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'created_at' + - 'updated_at' + - 'is_default' + - 'workspace_count' + - 'workspace_ids' + - 'opted_out_workspace_ids' + - 'is_synced' + - 'is_workspace_default_synced' + type: 'object' + ModelAvailabilityAccountGuardrailPolicyRequest: + example: + config: + allowed_models: + - 'openai/gpt-4o' + - 'anthropic/claude-sonnet-4' + allowed_providers: + - 'openai' + - 'anthropic' + enforce_zdr_anthropic: true + enforce_zdr_openai: true + name: 'Approved models' + policy_type: 'model_availability' + workspace_ids: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + properties: + config: + $ref: '#/components/schemas/GuardrailModelAvailabilityPolicyAuthoringConfig' + floor_reassignment: + description: 'Move workspaces off this policy onto another workspace-wide policy in the same write' + properties: + policy_id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + workspace_ids: + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + minItems: 1 + type: 'array' + required: + - 'policy_id' + - 'workspace_ids' + type: 'object' + is_default: + description: 'Cover every workspace in the account except `opted_out_workspace_ids`. On update, `false` on the current default unsets it.' + type: 'boolean' + keep_previous_default_workspaces: + description: 'Keep workspaces that inherited the replaced default on that policy. Cannot be combined with `released_floor_workspace_ids`.' + type: 'boolean' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_workspace_ids: + description: 'Workspaces left out of a default policy' + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + policy_type: + enum: + - 'model_availability' + type: 'string' + released_floor_workspace_ids: + description: 'Workspaces whose own workspace-wide policy of this type is dropped so they inherit this default' + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + workspace_ids: + description: 'Workspaces the policy covers when it is not the default' + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + required: + - 'name' + - 'policy_type' + - 'config' + type: 'object' + ModelAvailabilityGuardrailPolicy: + properties: + config: + $ref: '#/components/schemas/GuardrailModelAvailabilityPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + policy_type: + enum: + - 'model_availability' + type: 'string' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + type: 'object' + ModelAvailabilityGuardrailPolicyDetail: + properties: + api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailModelAvailabilityPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_workspace_default: + type: 'boolean' + member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + opted_out_member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + overridden_api_key_hashes: + description: 'API keys that have a different policy of this type assigned directly' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + overridden_member_ids: + description: 'Members that have a different policy of this type assigned directly' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + policy_type: + enum: + - 'model_availability' + type: 'string' + reference: + default: null + description: '`legacy_mapping` when the policy is synced from a v1 guardrail, `account_default` when it is an account-wide default, otherwise `null`' + enum: + - 'legacy_mapping' + - 'account_default' + - null + type: + - 'string' + - 'null' + replaces_legacy_default: + description: 'Whether this workspace copy replaced a v1 workspace default guardrail that still exists; it cannot be deleted' + type: 'boolean' + updated_at: + type: + - 'string' + - 'null' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'updated_at' + - 'member_ids' + - 'api_key_hashes' + - 'opted_out_api_key_hashes' + - 'overridden_api_key_hashes' + type: 'object' + ModelAvailabilityGuardrailPolicyDetailResponse: + properties: + data: + $ref: '#/components/schemas/ModelAvailabilityGuardrailPolicyDetail' + required: + - 'data' + type: 'object' + ModelAvailabilityGuardrailPolicyResponse: + properties: + data: + $ref: '#/components/schemas/ModelAvailabilityGuardrailPolicy' + required: + - 'data' + type: 'object' + ModelAvailabilityGuardrailPolicySummary: + properties: + api_key_count: + minimum: 0 + type: 'integer' + config: + $ref: '#/components/schemas/GuardrailModelAvailabilityPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_legacy_mapped: + description: 'Whether the policy is kept in sync with a v1 guardrail' + type: 'boolean' + is_workspace_default: + type: 'boolean' + legacy_guardrail_ids: + description: 'IDs of the v1 guardrails this policy was migrated from' + items: + type: 'string' + type: 'array' + member_count: + minimum: 0 + type: 'integer' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + policy_type: + enum: + - 'model_availability' + type: 'string' + replaced_legacy_guardrail_ids: + description: 'IDs of the v1 guardrails this policy replaced' + items: + type: 'string' + type: 'array' + updated_at: + type: + - 'string' + - 'null' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'updated_at' + - 'member_count' + - 'api_key_count' + type: 'object' ModelBenchmarks: description: 'Third-party benchmark rankings for this model. Omitted when no benchmark data is available.' example: @@ -20293,6 +21785,347 @@ components: items: $ref: '#/components/schemas/Model' type: 'array' + ModerationAccountGuardrailPolicy: + properties: + config: + $ref: '#/components/schemas/GuardrailModerationPolicyConfig' + created_at: + example: '2025-08-24T10:30:00Z' + type: 'string' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_default: + type: 'boolean' + is_synced: + description: 'Kept in sync with a v1 guardrail; saving changes creates an account copy' + type: 'boolean' + is_workspace_default_synced: + description: 'Synced from a v1 workspace default guardrail' + type: 'boolean' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_workspace_ids: + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + policy_type: + enum: + - 'moderation' + type: 'string' + updated_at: + type: + - 'string' + - 'null' + workspace_count: + minimum: 0 + type: 'integer' + workspace_ids: + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'created_at' + - 'updated_at' + - 'is_default' + - 'workspace_count' + - 'workspace_ids' + - 'opted_out_workspace_ids' + - 'is_synced' + - 'is_workspace_default_synced' + type: 'object' + ModerationAccountGuardrailPolicyRequest: + example: + config: + content_filter_builtins: + - action: 'block' + slug: 'secrets' + name: 'Block secrets' + policy_type: 'moderation' + workspace_ids: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + properties: + config: + $ref: '#/components/schemas/GuardrailModerationPolicyConfig' + floor_reassignment: + description: 'Move workspaces off this policy onto another workspace-wide policy in the same write' + properties: + policy_id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + workspace_ids: + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + minItems: 1 + type: 'array' + required: + - 'policy_id' + - 'workspace_ids' + type: 'object' + is_default: + description: 'Cover every workspace in the account except `opted_out_workspace_ids`. On update, `false` on the current default unsets it.' + type: 'boolean' + keep_previous_default_workspaces: + description: 'Keep workspaces that inherited the replaced default on that policy. Cannot be combined with `released_floor_workspace_ids`.' + type: 'boolean' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_workspace_ids: + description: 'Workspaces left out of a default policy' + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + policy_type: + enum: + - 'moderation' + type: 'string' + released_floor_workspace_ids: + description: 'Workspaces whose own workspace-wide policy of this type is dropped so they inherit this default' + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + workspace_ids: + description: 'Workspaces the policy covers when it is not the default' + example: + - '0df9e665-d932-5740-b2c7-b52af166bc11' + items: + format: 'uuid' + type: 'string' + type: 'array' + required: + - 'name' + - 'policy_type' + - 'config' + type: 'object' + ModerationGuardrailPolicy: + properties: + config: + $ref: '#/components/schemas/GuardrailModerationPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + policy_type: + enum: + - 'moderation' + type: 'string' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + type: 'object' + ModerationGuardrailPolicyDetail: + properties: + api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailModerationPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_account_policy: + description: 'Whether this is an account-owned policy rather than a workspace policy' + type: 'boolean' + is_workspace_default: + type: 'boolean' + member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + opted_out_member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + overridden_api_key_hashes: + description: 'API keys that have a different policy of this type assigned directly' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + overridden_member_ids: + description: 'Members that have a different policy of this type assigned directly' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + policy_type: + enum: + - 'moderation' + type: 'string' + reference: + default: null + description: '`legacy_mapping` when the policy is synced from a v1 guardrail, `account_default` when it is an account-wide default, otherwise `null`' + enum: + - 'legacy_mapping' + - 'account_default' + - null + type: + - 'string' + - 'null' + replaces_legacy_default: + description: 'Whether this workspace copy replaced a v1 workspace default guardrail that still exists; it cannot be deleted' + type: 'boolean' + updated_at: + type: + - 'string' + - 'null' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'updated_at' + - 'member_ids' + - 'api_key_hashes' + - 'opted_out_api_key_hashes' + - 'overridden_api_key_hashes' + type: 'object' + ModerationGuardrailPolicyDetailResponse: + properties: + data: + $ref: '#/components/schemas/ModerationGuardrailPolicyDetail' + required: + - 'data' + type: 'object' + ModerationGuardrailPolicyResponse: + properties: + data: + $ref: '#/components/schemas/ModerationGuardrailPolicy' + required: + - 'data' + type: 'object' + ModerationGuardrailPolicySummary: + properties: + api_key_count: + minimum: 0 + type: 'integer' + config: + $ref: '#/components/schemas/GuardrailModerationPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_legacy_mapped: + description: 'Whether the policy is kept in sync with a v1 guardrail' + type: 'boolean' + is_workspace_default: + type: 'boolean' + legacy_guardrail_ids: + description: 'IDs of the v1 guardrails this policy was migrated from' + items: + type: 'string' + type: 'array' + member_count: + minimum: 0 + type: 'integer' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + policy_type: + enum: + - 'moderation' + type: 'string' + replaced_legacy_guardrail_ids: + description: 'IDs of the v1 guardrails this policy replaced' + items: + type: 'string' + type: 'array' + updated_at: + type: + - 'string' + - 'null' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'updated_at' + - 'member_count' + - 'api_key_count' + type: 'object' ModerationPlugin: example: id: 'moderation' @@ -34073,6 +35906,65 @@ components: - 'code' - 'message' type: 'object' + UpdateBudgetGuardrailPolicyRequest: + properties: + api_key_hashes: + description: 'Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailBudgetPolicyAuthoringConfig' + is_workspace_default: + description: 'Omit to keep the stored default status; `false` unsets the policy as the workspace default.' + type: 'boolean' + member_ids: + description: 'Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments.' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + opted_out_member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + workspace_id: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + required: + - 'name' + - 'config' + - 'workspace_id' + type: 'object' UpdateBYOKKeyRequest: example: disabled: false @@ -34409,6 +36301,124 @@ components: required: - 'data' type: 'object' + UpdateModelAvailabilityGuardrailPolicyRequest: + properties: + api_key_hashes: + description: 'Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailModelAvailabilityPolicyAuthoringConfig' + is_workspace_default: + description: 'Omit to keep the stored default status; `false` unsets the policy as the workspace default.' + type: 'boolean' + member_ids: + description: 'Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments.' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + opted_out_member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + workspace_id: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + required: + - 'name' + - 'config' + - 'workspace_id' + type: 'object' + UpdateModerationGuardrailPolicyRequest: + properties: + api_key_hashes: + description: 'Complete new list of assigned API keys. Send together with `member_ids`, or omit both to keep the stored assignments.' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailModerationPolicyConfig' + is_workspace_default: + description: 'Omit to keep the stored default status; `false` unsets the policy as the workspace default.' + type: 'boolean' + member_ids: + description: 'Complete new list of assigned members. Send together with `api_key_hashes`, or omit both to keep the stored assignments.' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + opted_out_api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + opted_out_member_ids: + description: 'Organization member user IDs' + example: + - 'user_2abcDEFghiJKLmnoPQRstu' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + workspace_id: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + required: + - 'name' + - 'config' + - 'workspace_id' + type: 'object' UpdateObservabilityDestinationRequest: example: enabled: false @@ -44431,6 +46441,2087 @@ paths: outputs: results: '$.data' type: 'offsetLimit' + /guardrails/policies/account: + get: + description: 'List the workspace-wide policies that apply across workspaces in the account. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listAccountPolicies' + parameters: + - description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' + in: 'query' + name: 'offset' + required: false + schema: + description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' + example: 0 + minimum: 0 + type: 'integer' + - description: 'Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned' + in: 'query' + name: 'limit' + required: false + schema: + description: 'Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListAccountGuardrailPoliciesResponse' + description: 'List of workspace-wide policies' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List workspace-wide policies' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'listAccountPolicies' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' + post: + description: 'Create a workspace-wide budget, moderation, or model availability policy. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createAccountPolicy' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AccountGuardrailPolicyRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/AccountGuardrailPolicyResponse' + description: 'Workspace-wide policy created' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Create a workspace-wide policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'createAccountPolicy' + /guardrails/policies/account/{id}: + delete: + description: 'Delete a workspace-wide policy. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteAccountPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteGuardrailPolicyResponse' + description: 'Workspace-wide policy deleted' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Delete a workspace-wide policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'deleteAccountPolicy' + put: + description: 'Replace a workspace-wide policy and its workspace coverage. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateAccountPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AccountGuardrailPolicyRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AccountGuardrailPolicyResponse' + description: 'Workspace-wide policy updated' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Update a workspace-wide policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'updateAccountPolicy' + /guardrails/policies/assignments/api-keys/{hash}: + get: + description: 'Get the policies of one type that apply to an API key in a workspace. Requires a management key with write access. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getApiKeyPolicyAssignment' + parameters: + - description: 'API key hash' + in: 'path' + name: 'hash' + required: true + schema: + description: 'API key hash' + example: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + minLength: 1 + type: 'string' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + - description: 'Policy type the assignment is read or changed for' + in: 'query' + name: 'policy_type' + required: true + schema: + description: 'Policy type the assignment is read or changed for' + enum: + - 'budget' + - 'model_availability' + - 'moderation' + - 'rate_limit' + example: 'budget' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GuardrailPolicyAssignmentResponse' + description: 'Assignment state' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get an API key policy assignment' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'getApiKeyPolicyAssignment' + put: + description: 'Assign or unassign one policy for an API key. Fails with 409 when `expected_assignment` no longer matches the stored state. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'changeApiKeyPolicyAssignment' + parameters: + - description: 'API key hash' + in: 'path' + name: 'hash' + required: true + schema: + description: 'API key hash' + example: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + minLength: 1 + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeGuardrailPolicyAssignmentRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeGuardrailPolicyAssignmentResponse' + description: 'Assignment changed' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Change an API key policy assignment' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'changeApiKeyPolicyAssignment' + /guardrails/policies/assignments/members/{member_id}: + get: + description: 'Get the policies of one type that apply to a member in a workspace. Requires a management key with write access. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getMemberPolicyAssignment' + parameters: + - description: 'Organization member user ID' + in: 'path' + name: 'member_id' + required: true + schema: + description: 'Organization member user ID' + example: 'user_2abcDEFghiJKLmnoPQRstu' + minLength: 1 + type: 'string' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + - description: 'Policy type the assignment is read or changed for' + in: 'query' + name: 'policy_type' + required: true + schema: + description: 'Policy type the assignment is read or changed for' + enum: + - 'budget' + - 'model_availability' + - 'moderation' + - 'rate_limit' + example: 'budget' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GuardrailPolicyAssignmentResponse' + description: 'Assignment state' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get a member policy assignment' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'getMemberPolicyAssignment' + put: + description: 'Assign or unassign one policy for a member. Fails with 409 when `expected_assignment` no longer matches the stored state. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'changeMemberPolicyAssignment' + parameters: + - description: 'Organization member user ID' + in: 'path' + name: 'member_id' + required: true + schema: + description: 'Organization member user ID' + example: 'user_2abcDEFghiJKLmnoPQRstu' + minLength: 1 + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeGuardrailPolicyAssignmentRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeGuardrailPolicyAssignmentResponse' + description: 'Assignment changed' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Change a member policy assignment' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'changeMemberPolicyAssignment' + /guardrails/policies/budget: + get: + description: 'List the budget policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listBudgetPolicies' + parameters: + - description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' + in: 'query' + name: 'offset' + required: false + schema: + description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' + example: 0 + minimum: 0 + type: 'integer' + - description: 'Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned' + in: 'query' + name: 'limit' + required: false + schema: + description: 'Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListBudgetGuardrailPoliciesResponse' + description: 'List of budget policies' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List budget policies' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'listBudgetPolicies' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' + post: + description: 'Create a budget policy in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createBudgetPolicy' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateBudgetGuardrailPolicyRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/BudgetGuardrailPolicyResponse' + description: 'budget policy created' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Create a budget policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'createBudgetPolicy' + /guardrails/policies/budget/{id}: + delete: + description: 'Delete a budget policy. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteBudgetPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteGuardrailPolicyResponse' + description: 'budget policy deleted' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Delete a budget policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'deleteBudgetPolicy' + get: + description: 'Get a budget policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getBudgetPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BudgetGuardrailPolicyDetailResponse' + description: 'budget policy details' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get a budget policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'getBudgetPolicy' + put: + description: 'Replace a budget policy''s name and config, and optionally its assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateBudgetPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateBudgetGuardrailPolicyRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BudgetGuardrailPolicyResponse' + description: 'budget policy updated' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Update a budget policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'updateBudgetPolicy' + /guardrails/policies/model-availability: + get: + description: 'List the model availability policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listModelAvailabilityPolicies' + parameters: + - description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' + in: 'query' + name: 'offset' + required: false + schema: + description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' + example: 0 + minimum: 0 + type: 'integer' + - description: 'Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned' + in: 'query' + name: 'limit' + required: false + schema: + description: 'Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListModelAvailabilityGuardrailPoliciesResponse' + description: 'List of model availability policies' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List model availability policies' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'listModelAvailabilityPolicies' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' + post: + description: 'Create a model availability policy in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createModelAvailabilityPolicy' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateModelAvailabilityGuardrailPolicyRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ModelAvailabilityGuardrailPolicyResponse' + description: 'model availability policy created' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Create a model availability policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'createModelAvailabilityPolicy' + /guardrails/policies/model-availability/{id}: + delete: + description: 'Delete a model availability policy. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteModelAvailabilityPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteGuardrailPolicyResponse' + description: 'model availability policy deleted' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Delete a model availability policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'deleteModelAvailabilityPolicy' + get: + description: 'Get a model availability policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getModelAvailabilityPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ModelAvailabilityGuardrailPolicyDetailResponse' + description: 'model availability policy details' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get a model availability policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'getModelAvailabilityPolicy' + put: + description: 'Replace a model availability policy''s name and config, and optionally its assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateModelAvailabilityPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateModelAvailabilityGuardrailPolicyRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ModelAvailabilityGuardrailPolicyResponse' + description: 'model availability policy updated' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Update a model availability policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'updateModelAvailabilityPolicy' + /guardrails/policies/moderation: + get: + description: 'List the moderation policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listModerationPolicies' + parameters: + - description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' + in: 'query' + name: 'offset' + required: false + schema: + description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' + example: 0 + minimum: 0 + type: 'integer' + - description: 'Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned' + in: 'query' + name: 'limit' + required: false + schema: + description: 'Maximum number of records to return (max 100). When both offset and limit are omitted, the full list is returned' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListModerationGuardrailPoliciesResponse' + description: 'List of moderation policies' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List moderation policies' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'listModerationPolicies' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' + post: + description: 'Create a moderation policy in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createModerationPolicy' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateModerationGuardrailPolicyRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ModerationGuardrailPolicyResponse' + description: 'moderation policy created' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Create a moderation policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'createModerationPolicy' + /guardrails/policies/moderation/{id}: + delete: + description: 'Delete a moderation policy. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteModerationPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteGuardrailPolicyResponse' + description: 'moderation policy deleted' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Delete a moderation policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'deleteModerationPolicy' + get: + description: 'Get a moderation policy with its member and API key assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getModerationPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + - description: 'Workspace the policy belongs to' + in: 'query' + name: 'workspace_id' + required: true + schema: + description: 'Workspace the policy belongs to' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ModerationGuardrailPolicyDetailResponse' + description: 'moderation policy details' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get a moderation policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'getModerationPolicy' + put: + description: 'Replace a moderation policy''s name and config, and optionally its assignments. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateModerationPolicy' + parameters: + - description: 'Policy ID' + in: 'path' + name: 'id' + required: true + schema: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateModerationGuardrailPolicyRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ModerationGuardrailPolicyResponse' + description: 'moderation policy updated' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Update a moderation policy' + tags: + - 'Guardrail Policies' + x-speakeasy-name-override: 'updateModerationPolicy' /images: post: description: 'Generates an image from a text prompt via the image generation router' @@ -56562,6 +60653,8 @@ tags: name: 'Files' - description: 'Generation history endpoints' name: 'Generations' + - description: 'Guardrail Policies endpoints' + name: 'Guardrail Policies' - description: 'Guardrails endpoints' name: 'Guardrails' - description: 'Images endpoints'