From f3badd393ea56ec8a51f1ecf77c33e823d2e1f38 Mon Sep 17 00:00:00 2001 From: OpenRouter SDK Bot Date: Thu, 3 Dec 2026 05:23:50 +0000 Subject: [PATCH] chore: update OpenAPI spec [sdk-bot] --- .speakeasy/in.openapi.yaml | 1606 +++++++++++++++++++++++++++--------- 1 file changed, 1230 insertions(+), 376 deletions(-) diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index a9a3a598..3a657a25 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -7694,6 +7694,185 @@ components: - $ref: '#/components/schemas/EnumCapability' - $ref: '#/components/schemas/RangeCapability' - $ref: '#/components/schemas/BooleanCapability' + CapacityGuardrailPolicy: + properties: + config: + $ref: '#/components/schemas/GuardrailCapacityPolicyConfig' + 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: + - 'rate_limit' + type: 'string' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + type: 'object' + CapacityGuardrailPolicyDetail: + properties: + api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailCapacityPolicyConfig' + 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: + - 'rate_limit' + 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' + 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' + CapacityGuardrailPolicyDetailResponse: + properties: + data: + $ref: '#/components/schemas/CapacityGuardrailPolicyDetail' + required: + - 'data' + type: 'object' + CapacityGuardrailPolicyResponse: + properties: + data: + $ref: '#/components/schemas/CapacityGuardrailPolicy' + required: + - 'data' + type: 'object' + CapacityGuardrailPolicySummary: + properties: + api_key_count: + minimum: 0 + type: 'integer' + config: + $ref: '#/components/schemas/GuardrailCapacityPolicyConfig' + id: + description: 'Policy ID' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + is_workspace_default: + type: 'boolean' + member_count: + minimum: 0 + type: 'integer' + name: + description: 'Policy name' + example: 'Engineering monthly budget' + maxLength: 255 + minLength: 1 + type: 'string' + policy_type: + enum: + - 'rate_limit' + type: 'string' + updated_at: + type: + - 'string' + - 'null' + required: + - 'id' + - 'name' + - 'policy_type' + - 'config' + - 'updated_at' + - 'member_count' + - 'api_key_count' + type: 'object' ChangeGuardrailPolicyAssignmentRequest: properties: assigned: @@ -7710,7 +7889,7 @@ components: format: 'uuid' type: 'string' policy_type: - description: 'Policy type the assignment is read or changed for' + description: 'Policy type the assignment is read or changed for. `rate_limit` is an Enterprise private beta feature and requires an organization-scoped management key and an explicit `workspace_id`.' enum: - 'budget' - 'model_availability' @@ -10637,6 +10816,9 @@ components: minLength: 1 type: 'string' type: 'array' + move_existing_assignments: + description: 'When creating a new workspace default, also move the replaced default policy''s explicit member and API key assignments onto this policy. Defaults to `false`.' + type: 'boolean' name: description: 'Policy name' example: 'Engineering monthly budget' @@ -10799,6 +10981,73 @@ components: required: - 'data' type: 'object' + CreateCapacityGuardrailPolicyRequest: + properties: + api_key_hashes: + description: 'API key hashes' + example: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + items: + maxLength: 255 + minLength: 1 + type: 'string' + type: 'array' + config: + $ref: '#/components/schemas/GuardrailCapacityPolicyConfig' + 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' + move_existing_assignments: + description: 'When creating a new workspace default, also move the replaced default policy''s explicit member and API key assignments onto this policy. Defaults to `false`.' + type: 'boolean' + 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: + - 'rate_limit' + type: 'string' + workspace_id: + description: 'Workspace the capacity policy belongs to. Capacity policies require an organization-scoped management key.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + required: + - 'name' + - 'policy_type' + - 'config' + - 'workspace_id' + type: 'object' CreateCreditPurchaseRequest: properties: credit_amount_usd: @@ -11145,6 +11394,9 @@ components: minLength: 1 type: 'string' type: 'array' + move_existing_assignments: + description: 'When creating a new workspace default, also move the replaced default policy''s explicit member and API key assignments onto this policy. Defaults to `false`.' + type: 'boolean' name: description: 'Policy name' example: 'Engineering monthly budget' @@ -11208,6 +11460,9 @@ components: minLength: 1 type: 'string' type: 'array' + move_existing_assignments: + description: 'When creating a new workspace default, also move the replaced default policy''s explicit member and API key assignments onto this policy. Defaults to `false`.' + type: 'boolean' name: description: 'Policy name' example: 'Engineering monthly budget' @@ -16487,6 +16742,79 @@ components: reset_interval: $ref: '#/components/schemas/GuardrailInterval' type: 'object' + GuardrailCapacityLimit: + additionalProperties: false + properties: + limit: + description: 'Bucket capacity and per-minute refill rate.' + example: 100000 + minimum: 1 + type: 'integer' + models: + anyOf: + - description: 'Apply this limit to every model.' + enum: + - 'all' + type: 'string' + - description: 'Exact model slugs covered by this limit (wildcards are not supported).' + example: + - 'openai/gpt-4o' + items: + maxLength: 255 + minLength: 1 + type: 'string' + minItems: 1 + type: 'array' + description: 'Either `"all"` to cover every model or a non-empty list of exact model slugs.' + example: 'all' + unit: + description: 'Rate-limit unit: per-minute tokens (`tokens`) or requests (`requests`).' + enum: + - 'tokens' + - 'requests' + example: 'tokens' + type: 'string' + required: + - 'unit' + - 'limit' + - 'models' + type: 'object' + GuardrailCapacityPolicyConfig: + additionalProperties: false + example: + bucket_by: + - 'member' + - 'model' + limits: + - limit: 100000 + models: 'all' + unit: 'tokens' + properties: + bucket_by: + description: 'Distinct dimensions defining each rate-limit bucket. Must include `member` or `api_key` and end with `model`.' + example: + - 'member' + - 'model' + items: + enum: + - 'workspace' + - 'member' + - 'api_key' + - 'model' + type: 'string' + minItems: 1 + type: 'array' + limits: + description: 'One or more per-minute token or request limits (up to 200 entries and 200 listed models total).' + items: + $ref: '#/components/schemas/GuardrailCapacityLimit' + maxItems: 200 + minItems: 1 + type: 'array' + required: + - 'bucket_by' + - 'limits' + type: 'object' GuardrailDataRegion: description: 'An OpenRouter data region: `global` (https://openrouter.ai), `europe` (https://eu.openrouter.ai), or `us` (https://us.openrouter.ai)' enum: @@ -19018,6 +19346,21 @@ components: - 'data' - 'total_count' type: 'object' + ListCapacityGuardrailPoliciesResponse: + properties: + data: + items: + $ref: '#/components/schemas/CapacityGuardrailPolicySummary' + type: 'array' + total_count: + description: 'Total number of policies' + example: 1 + minimum: 0 + type: 'integer' + required: + - 'data' + - 'total_count' + type: 'object' ListEndpointsResponse: description: 'List of available endpoints for a model' example: @@ -39119,6 +39462,65 @@ components: required: - 'data' type: 'object' + UpdateCapacityGuardrailPolicyRequest: + 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/GuardrailCapacityPolicyConfig' + 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 capacity policy belongs to. Capacity policies require an organization-scoped management key.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + required: + - 'name' + - 'config' + - 'workspace_id' + type: 'object' UpdateExternalUserRequest: additionalProperties: false example: @@ -51040,22 +51442,642 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Create a workspace-wide policy' + 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. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + in: 'query' + name: 'workspace_id' + required: false + schema: + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + - description: 'Policy type the assignment is read or changed for. `rate_limit` is an Enterprise private beta feature and requires an organization-scoped management key and an explicit `workspace_id`.' + in: 'query' + name: 'policy_type' + required: true + schema: + description: 'Policy type the assignment is read or changed for. `rate_limit` is an Enterprise private beta feature and requires an organization-scoped management key and an explicit `workspace_id`.' + 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. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + in: 'query' + name: 'workspace_id' + required: false + schema: + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' + - description: 'Policy type the assignment is read or changed for. `rate_limit` is an Enterprise private beta feature and requires an organization-scoped management key and an explicit `workspace_id`.' + in: 'query' + name: 'policy_type' + required: true + schema: + description: 'Policy type the assignment is read or changed for. `rate_limit` is an Enterprise private beta feature and requires an organization-scoped management key and an explicit `workspace_id`.' + 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/assignments/scim-groups: + get: + description: 'List the guardrail policies attached to each SCIM group mapping in the organization. Requires `scim:view` and `guardrails:view`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listScimGroupPolicyAssignments' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListScimGroupPolicyAssignmentsResponse' + description: 'Policy assignments for every SCIM group mapping' + '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: 'List SCIM group policy assignments' 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' + /guardrails/policies/assignments/scim-groups/{mapping_id}: + get: + description: 'Get the guardrail policies attached to one SCIM group mapping. Requires `scim:view` and `guardrails:view`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getScimGroupPolicyAssignment' parameters: - - description: 'Policy ID' - in: 'path' - name: 'id' + - in: 'path' + name: 'mapping_id' required: true schema: - description: 'Policy ID' - example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' responses: @@ -51063,8 +52085,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DeleteGuardrailPolicyResponse' - description: 'Workspace-wide policy deleted' + $ref: '#/components/schemas/ScimGroupPolicyAssignmentResponse' + description: 'Policy assignment for the SCIM group mapping' '400': content: application/json: @@ -51125,36 +52147,32 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Delete a workspace-wide policy' + summary: 'Get a SCIM group policy assignment' 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' + patch: + description: 'Attach or remove guardrail policies on one SCIM group mapping, then update its members'' policies. Every type in the request is applied, or none is. Requires `scim:view`, `guardrails:view` and `guardrails:update`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateScimGroupPolicyAssignment' parameters: - - description: 'Policy ID' - in: 'path' - name: 'id' + - in: 'path' + name: 'mapping_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' + $ref: '#/components/schemas/UpdateScimGroupPolicyAssignmentRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/AccountGuardrailPolicyResponse' - description: 'Workspace-wide policy updated' + $ref: '#/components/schemas/ScimGroupPolicyAssignmentResponse' + description: 'Updated policy assignment' '400': content: application/json: @@ -51215,53 +52233,44 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Update a workspace-wide policy' + summary: 'Update a SCIM group policy assignment' 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' + /guardrails/policies/assignments/scim-groups/{mapping_id}/opt-outs: + delete: + description: 'Remove a member''s opt-out for one policy type, so the member receives their groups'' policy again right away. The member must be in the mapping''s group and the mapping must set a policy of that type. Requires `scim:view`, `guardrails:view` and `guardrails:update`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteScimGroupPolicyOptOut' parameters: - - description: 'API key hash' - in: 'path' - name: 'hash' + - in: 'path' + name: 'mapping_id' required: true schema: - description: 'API key hash' - example: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' - minLength: 1 + format: 'uuid' type: 'string' - - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' - in: 'query' - name: 'workspace_id' - required: false + - in: 'query' + name: 'user_id' + required: true schema: - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' - example: '0df9e665-d932-5740-b2c7-b52af166bc11' - format: 'uuid' + maxLength: 255 + minLength: 1 type: 'string' - - description: 'Policy type the assignment is read or changed for' - in: 'query' + - 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' + $ref: '#/components/schemas/DeleteScimGroupOptOutResponse' + description: 'Opt-out removed' '400': content: application/json: @@ -51302,6 +52311,16 @@ paths: 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: @@ -51312,36 +52331,26 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Get an API key policy assignment' + summary: 'Restore a member to a SCIM group policy' 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' + get: + description: 'List the group''s members who opted out of a guardrail policy this mapping sets, per policy type. Opted-out members keep their own assignment (or none) instead of the group policy. Requires `scim:view` and `guardrails:view`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listScimGroupPolicyOptOuts' parameters: - - description: 'API key hash' - in: 'path' - name: 'hash' + - in: 'path' + name: 'mapping_id' required: true schema: - description: 'API key hash' - example: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' - minLength: 1 + format: 'uuid' 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' + $ref: '#/components/schemas/ListScimGroupOptOutsResponse' + description: 'Opt-outs from the group policies' '400': content: application/json: @@ -51402,24 +52411,33 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Change an API key policy assignment' + summary: 'List opt-outs from a SCIM group policy assignment' tags: - 'Guardrail Policies' - x-speakeasy-name-override: 'changeApiKeyPolicyAssignment' - /guardrails/policies/assignments/members/{member_id}: + /guardrails/policies/budget: 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' + description: 'List the budget policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listBudgetPolicies' parameters: - - description: 'Organization member user ID' - in: 'path' - name: 'member_id' - required: true + - 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: 'Organization member user ID' - example: 'user_2abcDEFghiJKLmnoPQRstu' - minLength: 1 - type: 'string' + 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. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' in: 'query' name: 'workspace_id' @@ -51429,26 +52447,13 @@ paths: 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' + $ref: '#/components/schemas/ListBudgetGuardrailPoliciesResponse' + description: 'List of budget policies' '400': content: application/json: @@ -51499,36 +52504,37 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Get a member policy assignment' + summary: 'List budget policies' 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' + 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/ChangeGuardrailPolicyAssignmentRequest' + $ref: '#/components/schemas/CreateBudgetGuardrailPolicyRequest' required: true responses: - '200': + '201': content: application/json: schema: - $ref: '#/components/schemas/ChangeGuardrailPolicyAssignmentResponse' - description: 'Assignment changed' + $ref: '#/components/schemas/BudgetGuardrailPolicyResponse' + description: 'budget policy created' '400': content: application/json: @@ -51589,21 +52595,40 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Change a member policy assignment' + summary: 'Create a budget policy' tags: - 'Guardrail Policies' - x-speakeasy-name-override: 'changeMemberPolicyAssignment' - /guardrails/policies/assignments/scim-groups: - get: - description: 'List the guardrail policies attached to each SCIM group mapping in the organization. Requires `scim:view` and `guardrails:view`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listScimGroupPolicyAssignments' + 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. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + in: 'query' + name: 'workspace_id' + required: false + schema: + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + format: 'uuid' + type: 'string' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ListScimGroupPolicyAssignmentsResponse' - description: 'Policy assignments for every SCIM group mapping' + $ref: '#/components/schemas/DeleteGuardrailPolicyResponse' + description: 'budget policy deleted' '400': content: application/json: @@ -51664,18 +52689,30 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List SCIM group policy assignments' + summary: 'Delete a budget policy' tags: - 'Guardrail Policies' - /guardrails/policies/assignments/scim-groups/{mapping_id}: + x-speakeasy-name-override: 'deleteBudgetPolicy' get: - description: 'Get the guardrail policies attached to one SCIM group mapping. Requires `scim:view` and `guardrails:view`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'getScimGroupPolicyAssignment' + 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: - - in: 'path' - name: 'mapping_id' + - 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. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + in: 'query' + name: 'workspace_id' + required: false + schema: + description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' responses: @@ -51683,8 +52720,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ScimGroupPolicyAssignmentResponse' - description: 'Policy assignment for the SCIM group mapping' + $ref: '#/components/schemas/BudgetGuardrailPolicyDetailResponse' + description: 'budget policy details' '400': content: application/json: @@ -51725,16 +52762,6 @@ paths: 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: @@ -51745,210 +52772,36 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Get a SCIM group policy assignment' + summary: 'Get a budget policy' tags: - 'Guardrail Policies' - patch: - description: 'Attach or remove guardrail policies on one SCIM group mapping, then update its members'' policies. Every type in the request is applied, or none is. Requires `scim:view`, `guardrails:view` and `guardrails:update`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'updateScimGroupPolicyAssignment' + 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: - - in: 'path' - name: 'mapping_id' + - 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/UpdateScimGroupPolicyAssignmentRequest' + $ref: '#/components/schemas/UpdateBudgetGuardrailPolicyRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/ScimGroupPolicyAssignmentResponse' - description: 'Updated policy assignment' - '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 SCIM group policy assignment' - tags: - - 'Guardrail Policies' - /guardrails/policies/assignments/scim-groups/{mapping_id}/opt-outs: - delete: - description: 'Remove a member''s opt-out for one policy type, so the member receives their groups'' policy again right away. The member must be in the mapping''s group and the mapping must set a policy of that type. Requires `scim:view`, `guardrails:view` and `guardrails:update`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'deleteScimGroupPolicyOptOut' - parameters: - - in: 'path' - name: 'mapping_id' - required: true - schema: - format: 'uuid' - type: 'string' - - in: 'query' - name: 'user_id' - required: true - schema: - maxLength: 255 - minLength: 1 - type: 'string' - - in: 'query' - name: 'policy_type' - required: true - schema: - enum: - - 'budget' - - 'model_availability' - - 'moderation' - - 'rate_limit' - type: 'string' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteScimGroupOptOutResponse' - description: 'Opt-out removed' - '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: 'Restore a member to a SCIM group policy' - tags: - - 'Guardrail Policies' - get: - description: 'List the group''s members who opted out of a guardrail policy this mapping sets, per policy type. Opted-out members keep their own assignment (or none) instead of the group policy. Requires `scim:view` and `guardrails:view`. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listScimGroupPolicyOptOuts' - parameters: - - in: 'path' - name: 'mapping_id' - required: true - schema: - format: 'uuid' - type: 'string' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListScimGroupOptOutsResponse' - description: 'Opt-outs from the group policies' + $ref: '#/components/schemas/BudgetGuardrailPolicyResponse' + description: 'budget policy updated' '400': content: application/json: @@ -52009,13 +52862,14 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List opt-outs from a SCIM group policy assignment' + summary: 'Update a budget policy' tags: - 'Guardrail Policies' - /guardrails/policies/budget: + x-speakeasy-name-override: 'updateBudgetPolicy' + /guardrails/policies/capacity: get: - description: 'List the budget policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listBudgetPolicies' + description: 'List the capacity policies in a workspace. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listCapacityPolicies' parameters: - description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' in: 'query' @@ -52036,12 +52890,12 @@ paths: maximum: 100 minimum: 1 type: 'integer' - - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + - description: 'Workspace the capacity policy belongs to. Capacity policies require an organization-scoped management key.' in: 'query' name: 'workspace_id' - required: false + required: true schema: - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + description: 'Workspace the capacity policy belongs to. Capacity policies require an organization-scoped management key.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -52050,8 +52904,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListBudgetGuardrailPoliciesResponse' - description: 'List of budget policies' + $ref: '#/components/schemas/ListCapacityGuardrailPoliciesResponse' + description: 'List of capacity policies' '400': content: application/json: @@ -52102,10 +52956,10 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List budget policies' + summary: 'List capacity policies' tags: - 'Guardrail Policies' - x-speakeasy-name-override: 'listBudgetPolicies' + x-speakeasy-name-override: 'listCapacityPolicies' x-speakeasy-pagination: inputs: - in: 'parameters' @@ -52118,21 +52972,21 @@ paths: 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' + description: 'Create a capacity policy in a workspace. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createCapacityPolicy' requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateBudgetGuardrailPolicyRequest' + $ref: '#/components/schemas/CreateCapacityGuardrailPolicyRequest' required: true responses: '201': content: application/json: schema: - $ref: '#/components/schemas/BudgetGuardrailPolicyResponse' - description: 'budget policy created' + $ref: '#/components/schemas/CapacityGuardrailPolicyResponse' + description: 'capacity policy created' '400': content: application/json: @@ -52193,14 +53047,14 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Create a budget policy' + summary: 'Create a capacity policy' tags: - 'Guardrail Policies' - x-speakeasy-name-override: 'createBudgetPolicy' - /guardrails/policies/budget/{id}: + x-speakeasy-name-override: 'createCapacityPolicy' + /guardrails/policies/capacity/{id}: delete: - description: 'Delete a budget policy. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'deleteBudgetPolicy' + description: 'Delete a capacity policy. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteCapacityPolicy' parameters: - description: 'Policy ID' in: 'path' @@ -52211,12 +53065,12 @@ paths: example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' - - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + - description: 'Workspace the capacity policy belongs to. Capacity policies require an organization-scoped management key.' in: 'query' name: 'workspace_id' - required: false + required: true schema: - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + description: 'Workspace the capacity policy belongs to. Capacity policies require an organization-scoped management key.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -52226,7 +53080,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeleteGuardrailPolicyResponse' - description: 'budget policy deleted' + description: 'capacity policy deleted' '400': content: application/json: @@ -52287,13 +53141,13 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Delete a budget policy' + summary: 'Delete a capacity policy' tags: - 'Guardrail Policies' - x-speakeasy-name-override: 'deleteBudgetPolicy' + x-speakeasy-name-override: 'deleteCapacityPolicy' 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' + description: 'Get a capacity policy with its member and API key assignments. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getCapacityPolicy' parameters: - description: 'Policy ID' in: 'path' @@ -52304,12 +53158,12 @@ paths: example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' - - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + - description: 'Workspace the capacity policy belongs to. Capacity policies require an organization-scoped management key.' in: 'query' name: 'workspace_id' - required: false + required: true schema: - description: 'Workspace the policy belongs to. Required for an organization management key; a workspace-scoped key defaults to its own workspace and gets 403 for any other.' + description: 'Workspace the capacity policy belongs to. Capacity policies require an organization-scoped management key.' example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' @@ -52318,8 +53172,8 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BudgetGuardrailPolicyDetailResponse' - description: 'budget policy details' + $ref: '#/components/schemas/CapacityGuardrailPolicyDetailResponse' + description: 'capacity policy details' '400': content: application/json: @@ -52370,13 +53224,13 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Get a budget policy' + summary: 'Get a capacity policy' tags: - 'Guardrail Policies' - x-speakeasy-name-override: 'getBudgetPolicy' + x-speakeasy-name-override: 'getCapacityPolicy' 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' + description: 'Replace a capacity policy''s name and config, and optionally its assignments. Enterprise private beta feature. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateCapacityPolicy' parameters: - description: 'Policy ID' in: 'path' @@ -52391,15 +53245,15 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateBudgetGuardrailPolicyRequest' + $ref: '#/components/schemas/UpdateCapacityGuardrailPolicyRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/BudgetGuardrailPolicyResponse' - description: 'budget policy updated' + $ref: '#/components/schemas/CapacityGuardrailPolicyResponse' + description: 'capacity policy updated' '400': content: application/json: @@ -52460,10 +53314,10 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Update a budget policy' + summary: 'Update a capacity policy' tags: - 'Guardrail Policies' - x-speakeasy-name-override: 'updateBudgetPolicy' + x-speakeasy-name-override: 'updateCapacityPolicy' /guardrails/policies/model-availability: get: description: 'List the model availability policies in a workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required.' @@ -59055,7 +59909,7 @@ paths: - 'Private Endpoints' x-speakeasy-name-override: 'list' post: - description: 'Create a private endpoint as a draft. Drafts are not routable: validate one with `POST /private-endpoints/{id}/validate`, then activate it with `POST /private-endpoints/{id}/activate`. Pass `activate` to do all three in one call; if validation fails the draft is kept and returned with the failed checks. Custom management keys with `private_endpoints:create` can only create drafts; passing `activate` requires a full organization Read/write management key and otherwise returns 403. Send an `Idempotency-Key` header to make retries safe: a repeated key with the same request returns the endpoint the first request created; reusing it with different fields returns 422 `idempotency_key_reused`. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools`. The response does not echo `declared_parameters` or `tested_parameters`; read them with `GET /private-endpoints/{id}`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + description: 'Create a private endpoint as a draft. Drafts are not routable: validate one with `POST /private-endpoints/{id}/validate`, then activate it with `POST /private-endpoints/{id}/activate`. Pass `activate` to do all three in one call; if validation fails the draft is kept and returned with the failed checks. Custom management keys with `private_endpoints:write` can create drafts; passing `activate` also requires `byok:write` (or a full organization Read/write management key) and otherwise returns 403. Send an `Idempotency-Key` header to make retries safe: a repeated key with the same request returns the endpoint the first request created; reusing it with different fields returns 422 `idempotency_key_reused`. Returns 400 `parameters_invalid` when `tool_choice` is declared without `tools`. The response does not echo `declared_parameters` or `tested_parameters`; read them with `GET /private-endpoints/{id}`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'createPrivateEndpoint' parameters: - description: 'Retry-safe create: a repeated create with the same key from the same organization returns the endpoint the first request created instead of creating another. The endpoint is returned as it is now. Reusing a key with a different request body (model, provider, base URL, upstream model ID, declared ZDR or region, pricing, or declared parameters) is rejected with 422 `idempotency_key_reused`. Declared parameters are compared as a set, so a retry that reorders or repeats a name replays the endpoint. `activate` and `settings` are not compared, and later edits to the endpoint do not affect the comparison. `settings` is still validated before the replay, so a retry with invalid settings returns 400 `settings_invalid` instead of the endpoint.' @@ -59831,7 +60685,7 @@ paths: x-speakeasy-name-override: 'enable' /private-endpoints/{id}/validate: post: - description: 'Send a live test request to the draft endpoint using the given workspace''s BYOK credential for its provider. A passing validation is required before activation. Failed checks return 200 with `passed: false`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + description: 'Send a live test request to the draft endpoint using the given workspace''s BYOK credential for its provider. A passing validation is required before activation. Failed checks return 200 with `passed: false`. Custom management keys require both `private_endpoints:write` and `byok:write`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' operationId: 'validatePrivateEndpoint' parameters: - description: 'Stable identifier of the private endpoint.'