anthropic 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/error_classes.rb +10 -0
  5. data/lib/anthropic/errors.rb +11 -0
  6. data/lib/anthropic/internal/tracing.rb +1 -0
  7. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  8. data/lib/anthropic/models/api_error_object.rb +9 -2
  9. data/lib/anthropic/models/authentication_error.rb +9 -2
  10. data/lib/anthropic/models/beta/beta_dreaming_error.rb +1 -1
  11. data/lib/anthropic/models/beta/beta_target_store_held_error.rb +1 -7
  12. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_error.rb +3 -1
  13. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error.rb +4 -3
  14. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_precondition_failed_error.rb +1 -3
  15. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_managed_member_error.rb +24 -0
  16. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_managed_member_error_details.rb +22 -0
  17. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_membership_admin_error.rb +24 -0
  18. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_membership_admin_error_details.rb +22 -0
  19. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_owner_error.rb +25 -0
  20. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_owner_error_details.rb +23 -0
  21. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_primary_owner_error.rb +24 -0
  22. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_primary_owner_error_details.rb +22 -0
  23. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_privileged_member_error.rb +24 -0
  24. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_privileged_member_error_details.rb +22 -0
  25. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_self_error.rb +23 -0
  26. data/lib/anthropic/models/beta/organization/beta_cannot_sign_out_self_error_details.rb +21 -0
  27. data/lib/anthropic/models/beta/organization/user_sign_out_params.rb +38 -0
  28. data/lib/anthropic/models/beta_api_error.rb +9 -2
  29. data/lib/anthropic/models/beta_authentication_error.rb +9 -2
  30. data/lib/anthropic/models/beta_billing_error.rb +9 -2
  31. data/lib/anthropic/models/beta_error.rb +4 -1
  32. data/lib/anthropic/models/beta_gateway_timeout_error.rb +9 -2
  33. data/lib/anthropic/models/beta_invalid_request_error.rb +9 -2
  34. data/lib/anthropic/models/beta_not_found_error.rb +9 -2
  35. data/lib/anthropic/models/beta_organization_not_enrolled_in_beta_error.rb +20 -0
  36. data/lib/anthropic/models/beta_organization_not_enrolled_in_beta_error_details.rb +18 -0
  37. data/lib/anthropic/models/beta_overloaded_error.rb +9 -2
  38. data/lib/anthropic/models/beta_permission_error.rb +9 -2
  39. data/lib/anthropic/models/beta_rate_limit_error.rb +9 -2
  40. data/lib/anthropic/models/billing_error.rb +9 -2
  41. data/lib/anthropic/models/error_details.rb +69 -2
  42. data/lib/anthropic/models/error_object.rb +4 -1
  43. data/lib/anthropic/models/gateway_timeout_error.rb +9 -2
  44. data/lib/anthropic/models/invalid_request_error.rb +9 -2
  45. data/lib/anthropic/models/not_found_error.rb +9 -2
  46. data/lib/anthropic/models/organization/external_key_validation_failed_error.rb +22 -0
  47. data/lib/anthropic/models/organization/external_key_validation_failed_error_details.rb +20 -0
  48. data/lib/anthropic/models/organization/external_key_validation_timed_out_error.rb +22 -0
  49. data/lib/anthropic/models/organization/external_key_validation_timed_out_error_details.rb +20 -0
  50. data/lib/anthropic/models/overloaded_error.rb +9 -2
  51. data/lib/anthropic/models/permission_error.rb +9 -2
  52. data/lib/anthropic/models/ramp_limit_exceeded_error.rb +20 -0
  53. data/lib/anthropic/models/ramp_limit_exceeded_error_details.rb +18 -0
  54. data/lib/anthropic/models/rate_limit_error.rb +9 -2
  55. data/lib/anthropic/models.rb +9 -0
  56. data/lib/anthropic/resources/beta/environments/work.rb +10 -24
  57. data/lib/anthropic/resources/beta/environments.rb +16 -37
  58. data/lib/anthropic/resources/beta/files.rb +23 -50
  59. data/lib/anthropic/resources/beta/messages/batches.rb +15 -35
  60. data/lib/anthropic/resources/beta/messages.rb +74 -139
  61. data/lib/anthropic/resources/beta/models.rb +4 -10
  62. data/lib/anthropic/resources/beta/organization/api_keys.rb +2 -2
  63. data/lib/anthropic/resources/beta/organization/claude_tag/bundles/targets.rb +16 -24
  64. data/lib/anthropic/resources/beta/organization/claude_tag/bundles.rb +8 -12
  65. data/lib/anthropic/resources/beta/organization/claude_tag/slack_channels.rb +28 -46
  66. data/lib/anthropic/resources/beta/organization/claude_tag/slack_workspaces.rb +15 -24
  67. data/lib/anthropic/resources/beta/organization/external_keys.rb +3 -7
  68. data/lib/anthropic/resources/beta/organization/invites.rb +7 -17
  69. data/lib/anthropic/resources/beta/organization/plugin_marketplaces.rb +1 -2
  70. data/lib/anthropic/resources/beta/organization/plugins/versions.rb +7 -14
  71. data/lib/anthropic/resources/beta/organization/plugins.rb +12 -24
  72. data/lib/anthropic/resources/beta/organization/rbac_groups/members.rb +4 -14
  73. data/lib/anthropic/resources/beta/organization/rbac_groups.rb +2 -7
  74. data/lib/anthropic/resources/beta/organization/spend_limits/effective.rb +1 -2
  75. data/lib/anthropic/resources/beta/organization/spend_limits.rb +6 -12
  76. data/lib/anthropic/resources/beta/organization/users.rb +65 -4
  77. data/lib/anthropic/resources/beta/organization/workspaces/members.rb +2 -2
  78. data/lib/anthropic/resources/beta/organization/workspaces.rb +12 -22
  79. data/lib/anthropic/resources/beta/skills/versions.rb +11 -26
  80. data/lib/anthropic/resources/beta/skills.rb +11 -26
  81. data/lib/anthropic/resources/files.rb +23 -50
  82. data/lib/anthropic/resources/messages/batches.rb +15 -35
  83. data/lib/anthropic/resources/messages.rb +74 -139
  84. data/lib/anthropic/resources/models.rb +4 -10
  85. data/lib/anthropic/resources/organization/api_keys.rb +2 -2
  86. data/lib/anthropic/resources/organization/external_keys.rb +3 -7
  87. data/lib/anthropic/resources/organization/invites.rb +7 -17
  88. data/lib/anthropic/resources/organization/rbac_groups/members.rb +4 -14
  89. data/lib/anthropic/resources/organization/rbac_groups.rb +2 -7
  90. data/lib/anthropic/resources/organization/spend_limits/effective.rb +1 -2
  91. data/lib/anthropic/resources/organization/users.rb +2 -4
  92. data/lib/anthropic/resources/organization/workspaces/members.rb +2 -2
  93. data/lib/anthropic/resources/organization/workspaces.rb +12 -22
  94. data/lib/anthropic/resources/skills/versions.rb +11 -26
  95. data/lib/anthropic/resources/skills.rb +11 -26
  96. data/lib/anthropic/version.rb +1 -1
  97. data/lib/anthropic.rb +22 -0
  98. data/manifest.yaml +1 -0
  99. data/rbi/anthropic/errors.rbi +14 -0
  100. data/rbi/anthropic/internal/tracing.rbi +1 -0
  101. data/rbi/anthropic/models/anthropic_beta.rbi +5 -0
  102. data/rbi/anthropic/models/api_error_object.rbi +10 -1
  103. data/rbi/anthropic/models/authentication_error.rbi +10 -1
  104. data/rbi/anthropic/models/beta/beta_dreaming_error.rbi +2 -2
  105. data/rbi/anthropic/models/beta/beta_target_store_held_error.rbi +1 -8
  106. data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_error.rbi +2 -1
  107. data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_path_conflict_error.rbi +3 -4
  108. data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_precondition_failed_error.rbi +1 -6
  109. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_managed_member_error.rbi +25 -0
  110. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_managed_member_error_details.rbi +32 -0
  111. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_membership_admin_error.rbi +25 -0
  112. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_membership_admin_error_details.rbi +32 -0
  113. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_owner_error.rbi +26 -0
  114. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_owner_error_details.rbi +33 -0
  115. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_primary_owner_error.rbi +25 -0
  116. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_primary_owner_error_details.rbi +32 -0
  117. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_privileged_member_error.rbi +25 -0
  118. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_privileged_member_error_details.rbi +32 -0
  119. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_self_error.rbi +24 -0
  120. data/rbi/anthropic/models/beta/organization/beta_cannot_sign_out_self_error_details.rbi +31 -0
  121. data/rbi/anthropic/models/beta/organization/user_sign_out_params.rbi +75 -0
  122. data/rbi/anthropic/models/beta_api_error.rbi +10 -1
  123. data/rbi/anthropic/models/beta_authentication_error.rbi +10 -1
  124. data/rbi/anthropic/models/beta_billing_error.rbi +10 -1
  125. data/rbi/anthropic/models/beta_error.rbi +6 -1
  126. data/rbi/anthropic/models/beta_gateway_timeout_error.rbi +10 -1
  127. data/rbi/anthropic/models/beta_invalid_request_error.rbi +10 -1
  128. data/rbi/anthropic/models/beta_not_found_error.rbi +10 -1
  129. data/rbi/anthropic/models/beta_organization_not_enrolled_in_beta_error.rbi +17 -0
  130. data/rbi/anthropic/models/beta_organization_not_enrolled_in_beta_error_details.rbi +28 -0
  131. data/rbi/anthropic/models/beta_overloaded_error.rbi +10 -1
  132. data/rbi/anthropic/models/beta_permission_error.rbi +10 -1
  133. data/rbi/anthropic/models/beta_rate_limit_error.rbi +10 -1
  134. data/rbi/anthropic/models/billing_error.rbi +10 -1
  135. data/rbi/anthropic/models/error_details.rbi +60 -0
  136. data/rbi/anthropic/models/error_object.rbi +6 -1
  137. data/rbi/anthropic/models/gateway_timeout_error.rbi +10 -1
  138. data/rbi/anthropic/models/invalid_request_error.rbi +10 -1
  139. data/rbi/anthropic/models/not_found_error.rbi +10 -1
  140. data/rbi/anthropic/models/organization/external_key_validation_failed_error.rbi +23 -0
  141. data/rbi/anthropic/models/organization/external_key_validation_failed_error_details.rbi +30 -0
  142. data/rbi/anthropic/models/organization/external_key_validation_timed_out_error.rbi +23 -0
  143. data/rbi/anthropic/models/organization/external_key_validation_timed_out_error_details.rbi +30 -0
  144. data/rbi/anthropic/models/overloaded_error.rbi +10 -1
  145. data/rbi/anthropic/models/permission_error.rbi +10 -1
  146. data/rbi/anthropic/models/ramp_limit_exceeded_error.rbi +17 -0
  147. data/rbi/anthropic/models/ramp_limit_exceeded_error_details.rbi +28 -0
  148. data/rbi/anthropic/models/rate_limit_error.rbi +10 -1
  149. data/rbi/anthropic/models.rbi +11 -0
  150. data/rbi/anthropic/resources/beta/organization/users.rbi +43 -0
  151. data/sig/anthropic/errors.rbs +3 -0
  152. data/sig/anthropic/internal/tracing.rbs +1 -0
  153. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  154. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_managed_member_error.rbs +13 -0
  155. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_managed_member_error_details.rbs +18 -0
  156. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_membership_admin_error.rbs +13 -0
  157. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_membership_admin_error_details.rbs +20 -0
  158. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_owner_error.rbs +13 -0
  159. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_owner_error_details.rbs +18 -0
  160. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_primary_owner_error.rbs +13 -0
  161. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_primary_owner_error_details.rbs +18 -0
  162. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_privileged_member_error.rbs +13 -0
  163. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_privileged_member_error_details.rbs +20 -0
  164. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_self_error.rbs +13 -0
  165. data/sig/anthropic/models/beta/organization/beta_cannot_sign_out_self_error_details.rbs +18 -0
  166. data/sig/anthropic/models/beta/organization/user_sign_out_params.rbs +36 -0
  167. data/sig/anthropic/models/beta_organization_not_enrolled_in_beta_error.rbs +9 -0
  168. data/sig/anthropic/models/beta_organization_not_enrolled_in_beta_error_details.rbs +14 -0
  169. data/sig/anthropic/models/error_details.rbs +67 -0
  170. data/sig/anthropic/models/organization/external_key_validation_failed_error.rbs +11 -0
  171. data/sig/anthropic/models/organization/external_key_validation_failed_error_details.rbs +16 -0
  172. data/sig/anthropic/models/organization/external_key_validation_timed_out_error.rbs +11 -0
  173. data/sig/anthropic/models/organization/external_key_validation_timed_out_error_details.rbs +18 -0
  174. data/sig/anthropic/models/ramp_limit_exceeded_error.rbs +9 -0
  175. data/sig/anthropic/models/ramp_limit_exceeded_error_details.rbs +14 -0
  176. data/sig/anthropic/models.rbs +8 -0
  177. data/sig/anthropic/resources/beta/organization/users.rbs +6 -0
  178. metadata +65 -2
@@ -34,6 +34,7 @@ module Anthropic
34
34
  Anthropic::SkillReadBlockedUndecryptableErrorDetails,
35
35
  Anthropic::RequestBodyTooLargeAfterDecodingErrorDetails,
36
36
  Anthropic::EnforcedSpendLimitReachedErrorDetails,
37
+ Anthropic::RampLimitExceededErrorDetails,
37
38
  Anthropic::CMEKKeyUnreachableErrorDetails,
38
39
  Anthropic::CompactionUnavailableErrorDetails,
39
40
  Anthropic::StorageQuotaExceededErrorDetails,
@@ -53,6 +54,8 @@ module Anthropic
53
54
  Anthropic::Organization::RBACGroupOwnerAccessUnconfirmedErrorDetails,
54
55
  Anthropic::Organization::CannotRemoveLastMemberErrorDetails,
55
56
  Anthropic::ConcurrentMembershipChangeErrorDetails,
57
+ Anthropic::Organization::ExternalKeyValidationFailedErrorDetails,
58
+ Anthropic::Organization::ExternalKeyValidationTimedOutErrorDetails,
56
59
  Anthropic::Organization::KeyProfileMismatchErrorDetails,
57
60
  Anthropic::Organization::WorkspacePolicyViolationErrorDetails,
58
61
  Anthropic::Organization::ExternalKeyChangedErrorDetails,
@@ -64,6 +67,13 @@ module Anthropic
64
67
  Anthropic::Beta::BetaEnvironmentUpdateDisabledErrorDetails,
65
68
  Anthropic::Beta::Environments::BetaHeartbeatPreconditionFailedErrorDetails,
66
69
  Anthropic::Beta::BetaInvalidMetadataErrorDetails,
70
+ Anthropic::Beta::Organization::BetaCannotSignOutPrimaryOwnerErrorDetails,
71
+ Anthropic::Beta::Organization::BetaCannotSignOutSelfErrorDetails,
72
+ Anthropic::BetaOrganizationNotEnrolledInBetaErrorDetails,
73
+ Anthropic::Beta::Organization::BetaCannotSignOutManagedMemberErrorDetails,
74
+ Anthropic::Beta::Organization::BetaCannotSignOutMembershipAdminErrorDetails,
75
+ Anthropic::Beta::Organization::BetaCannotSignOutOwnerErrorDetails,
76
+ Anthropic::Beta::Organization::BetaCannotSignOutPrivilegedMemberErrorDetails,
67
77
  Anthropic::Beta::BetaBillingFrozenErrorDetails,
68
78
  Anthropic::Beta::Organization::BetaSpendLimitsAdminAPIWritesNotEnabledErrorDetails,
69
79
  Anthropic::BetaUnsupportedCharsetErrorDetails,
@@ -220,6 +230,11 @@ module Anthropic
220
230
  :enforced_spend_limit_reached,
221
231
  Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
222
232
  )
233
+ RAMP_LIMIT_EXCEEDED =
234
+ T.let(
235
+ :ramp_limit_exceeded,
236
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
237
+ )
223
238
  CMEK_KEY_UNREACHABLE =
224
239
  T.let(
225
240
  :cmek_key_unreachable,
@@ -312,6 +327,16 @@ module Anthropic
312
327
  :concurrent_membership_change,
313
328
  Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
314
329
  )
330
+ EXTERNAL_KEY_VALIDATION_FAILED =
331
+ T.let(
332
+ :external_key_validation_failed,
333
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
334
+ )
335
+ EXTERNAL_KEY_VALIDATION_TIMED_OUT =
336
+ T.let(
337
+ :external_key_validation_timed_out,
338
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
339
+ )
315
340
  KEY_PROFILE_MISMATCH =
316
341
  T.let(
317
342
  :key_profile_mismatch,
@@ -367,6 +392,41 @@ module Anthropic
367
392
  :invalid_metadata,
368
393
  Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
369
394
  )
395
+ CANNOT_SIGN_OUT_PRIMARY_OWNER =
396
+ T.let(
397
+ :cannot_sign_out_primary_owner,
398
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
399
+ )
400
+ CANNOT_SIGN_OUT_SELF =
401
+ T.let(
402
+ :cannot_sign_out_self,
403
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
404
+ )
405
+ ORGANIZATION_NOT_ENROLLED_IN_BETA =
406
+ T.let(
407
+ :organization_not_enrolled_in_beta,
408
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
409
+ )
410
+ CANNOT_SIGN_OUT_MANAGED_MEMBER =
411
+ T.let(
412
+ :cannot_sign_out_managed_member,
413
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
414
+ )
415
+ CANNOT_SIGN_OUT_MEMBERSHIP_ADMIN =
416
+ T.let(
417
+ :cannot_sign_out_membership_admin,
418
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
419
+ )
420
+ CANNOT_SIGN_OUT_OWNER =
421
+ T.let(
422
+ :cannot_sign_out_owner,
423
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
424
+ )
425
+ CANNOT_SIGN_OUT_PRIVILEGED_MEMBER =
426
+ T.let(
427
+ :cannot_sign_out_privileged_member,
428
+ Anthropic::ErrorDetails::ErrorCode::TaggedSymbol
429
+ )
370
430
  BILLING_FROZEN =
371
431
  T.let(
372
432
  :billing_frozen,
@@ -71,7 +71,12 @@ module Anthropic
71
71
  message: String
72
72
  ).returns(Anthropic::ErrorObject::Variants)
73
73
  end
74
- def self.new(type:, message:)
74
+ def self.new(
75
+ type:,
76
+ # A human-readable explanation of the error. Its wording can change, so don't
77
+ # match on it.
78
+ message:
79
+ )
75
80
  end
76
81
  end
77
82
  end
@@ -8,14 +8,23 @@ module Anthropic
8
8
  T.any(Anthropic::GatewayTimeoutError, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # A human-readable explanation of the error. Its wording can change, so don't
12
+ # match on it.
11
13
  sig { returns(String) }
12
14
  attr_accessor :message
13
15
 
16
+ # The broad category of the error.
14
17
  sig { returns(Symbol) }
15
18
  attr_accessor :type
16
19
 
17
20
  sig { params(message: String, type: Symbol).returns(T.attached_class) }
18
- def self.new(message:, type: :timeout_error)
21
+ def self.new(
22
+ # A human-readable explanation of the error. Its wording can change, so don't
23
+ # match on it.
24
+ message:,
25
+ # The broad category of the error.
26
+ type: :timeout_error
27
+ )
19
28
  end
20
29
 
21
30
  sig { override.returns({ message: String, type: Symbol }) }
@@ -8,14 +8,23 @@ module Anthropic
8
8
  T.any(Anthropic::InvalidRequestError, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # A human-readable explanation of the error. Its wording can change, so don't
12
+ # match on it.
11
13
  sig { returns(String) }
12
14
  attr_accessor :message
13
15
 
16
+ # The broad category of the error.
14
17
  sig { returns(Symbol) }
15
18
  attr_accessor :type
16
19
 
17
20
  sig { params(message: String, type: Symbol).returns(T.attached_class) }
18
- def self.new(message:, type: :invalid_request_error)
21
+ def self.new(
22
+ # A human-readable explanation of the error. Its wording can change, so don't
23
+ # match on it.
24
+ message:,
25
+ # The broad category of the error.
26
+ type: :invalid_request_error
27
+ )
19
28
  end
20
29
 
21
30
  sig { override.returns({ message: String, type: Symbol }) }
@@ -8,14 +8,23 @@ module Anthropic
8
8
  T.any(Anthropic::NotFoundError, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # A human-readable explanation of the error. Its wording can change, so don't
12
+ # match on it.
11
13
  sig { returns(String) }
12
14
  attr_accessor :message
13
15
 
16
+ # The broad category of the error.
14
17
  sig { returns(Symbol) }
15
18
  attr_accessor :type
16
19
 
17
20
  sig { params(message: String, type: Symbol).returns(T.attached_class) }
18
- def self.new(message:, type: :not_found_error)
21
+ def self.new(
22
+ # A human-readable explanation of the error. Its wording can change, so don't
23
+ # match on it.
24
+ message:,
25
+ # The broad category of the error.
26
+ type: :not_found_error
27
+ )
19
28
  end
20
29
 
21
30
  sig { override.returns({ message: String, type: Symbol }) }
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Organization
6
+ # The External Key failed Anthropic's validation, so the request was refused. The
7
+ # message gives the reason, if there is one.
8
+ class ExternalKeyValidationFailedError < Anthropic::Errors::BadRequestError
9
+ sig { returns(Symbol) }
10
+ def error_code
11
+ end
12
+
13
+ sig do
14
+ returns(
15
+ Anthropic::Organization::ExternalKeyValidationFailedErrorDetails
16
+ )
17
+ end
18
+ def details
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Organization
6
+ class ExternalKeyValidationFailedErrorDetails < Anthropic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Anthropic::Organization::ExternalKeyValidationFailedErrorDetails,
11
+ Anthropic::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(Symbol) }
16
+ attr_accessor :error_code
17
+
18
+ # The External Key failed Anthropic's validation, so the request was refused. The
19
+ # message gives the reason, if there is one.
20
+ sig { params(error_code: Symbol).returns(T.attached_class) }
21
+ def self.new(error_code: :external_key_validation_failed)
22
+ end
23
+
24
+ sig { override.returns({ error_code: Symbol }) }
25
+ def to_hash
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Organization
6
+ # Anthropic's validation of the External Key did not finish in time, so the
7
+ # request was refused. Wait a moment, then send the request again.
8
+ class ExternalKeyValidationTimedOutError < Anthropic::Errors::BadRequestError
9
+ sig { returns(Symbol) }
10
+ def error_code
11
+ end
12
+
13
+ sig do
14
+ returns(
15
+ Anthropic::Organization::ExternalKeyValidationTimedOutErrorDetails
16
+ )
17
+ end
18
+ def details
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Organization
6
+ class ExternalKeyValidationTimedOutErrorDetails < Anthropic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Anthropic::Organization::ExternalKeyValidationTimedOutErrorDetails,
11
+ Anthropic::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(Symbol) }
16
+ attr_accessor :error_code
17
+
18
+ # Anthropic's validation of the External Key did not finish in time, so the
19
+ # request was refused. Wait a moment, then send the request again.
20
+ sig { params(error_code: Symbol).returns(T.attached_class) }
21
+ def self.new(error_code: :external_key_validation_timed_out)
22
+ end
23
+
24
+ sig { override.returns({ error_code: Symbol }) }
25
+ def to_hash
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -8,14 +8,23 @@ module Anthropic
8
8
  T.any(Anthropic::OverloadedError, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # A human-readable explanation of the error. Its wording can change, so don't
12
+ # match on it.
11
13
  sig { returns(String) }
12
14
  attr_accessor :message
13
15
 
16
+ # The broad category of the error.
14
17
  sig { returns(Symbol) }
15
18
  attr_accessor :type
16
19
 
17
20
  sig { params(message: String, type: Symbol).returns(T.attached_class) }
18
- def self.new(message:, type: :overloaded_error)
21
+ def self.new(
22
+ # A human-readable explanation of the error. Its wording can change, so don't
23
+ # match on it.
24
+ message:,
25
+ # The broad category of the error.
26
+ type: :overloaded_error
27
+ )
19
28
  end
20
29
 
21
30
  sig { override.returns({ message: String, type: Symbol }) }
@@ -8,14 +8,23 @@ module Anthropic
8
8
  T.any(Anthropic::PermissionError, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # A human-readable explanation of the error. Its wording can change, so don't
12
+ # match on it.
11
13
  sig { returns(String) }
12
14
  attr_accessor :message
13
15
 
16
+ # The broad category of the error.
14
17
  sig { returns(Symbol) }
15
18
  attr_accessor :type
16
19
 
17
20
  sig { params(message: String, type: Symbol).returns(T.attached_class) }
18
- def self.new(message:, type: :permission_error)
21
+ def self.new(
22
+ # A human-readable explanation of the error. Its wording can change, so don't
23
+ # match on it.
24
+ message:,
25
+ # The broad category of the error.
26
+ type: :permission_error
27
+ )
19
28
  end
20
29
 
21
30
  sig { override.returns({ message: String, type: Symbol }) }
@@ -0,0 +1,17 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ # The request would exceed a ramp limit, which caps how fast usage can grow. Retry
6
+ # after the time in the `retry-after` header.
7
+ class RampLimitExceededError < Anthropic::Errors::RateLimitError
8
+ sig { returns(Symbol) }
9
+ def error_code
10
+ end
11
+
12
+ sig { returns(Anthropic::RampLimitExceededErrorDetails) }
13
+ def details
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class RampLimitExceededErrorDetails < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Anthropic::RampLimitExceededErrorDetails,
10
+ Anthropic::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(Symbol) }
15
+ attr_accessor :error_code
16
+
17
+ # The request would exceed a ramp limit, which caps how fast usage can grow. Retry
18
+ # after the time in the `retry-after` header.
19
+ sig { params(error_code: Symbol).returns(T.attached_class) }
20
+ def self.new(error_code: :ramp_limit_exceeded)
21
+ end
22
+
23
+ sig { override.returns({ error_code: Symbol }) }
24
+ def to_hash
25
+ end
26
+ end
27
+ end
28
+ end
@@ -8,14 +8,23 @@ module Anthropic
8
8
  T.any(Anthropic::RateLimitError, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # A human-readable explanation of the error. Its wording can change, so don't
12
+ # match on it.
11
13
  sig { returns(String) }
12
14
  attr_accessor :message
13
15
 
16
+ # The broad category of the error.
14
17
  sig { returns(Symbol) }
15
18
  attr_accessor :type
16
19
 
17
20
  sig { params(message: String, type: Symbol).returns(T.attached_class) }
18
- def self.new(message:, type: :rate_limit_error)
21
+ def self.new(
22
+ # A human-readable explanation of the error. Its wording can change, so don't
23
+ # match on it.
24
+ message:,
25
+ # The broad category of the error.
26
+ type: :rate_limit_error
27
+ )
19
28
  end
20
29
 
21
30
  sig { override.returns({ message: String, type: Symbol }) }
@@ -66,6 +66,12 @@ module Anthropic
66
66
 
67
67
  BetaNotFoundError = Anthropic::Models::BetaNotFoundError
68
68
 
69
+ BetaOrganizationNotEnrolledInBetaError =
70
+ Anthropic::Models::BetaOrganizationNotEnrolledInBetaError
71
+
72
+ BetaOrganizationNotEnrolledInBetaErrorDetails =
73
+ Anthropic::Models::BetaOrganizationNotEnrolledInBetaErrorDetails
74
+
69
75
  BetaOverloadedError = Anthropic::Models::BetaOverloadedError
70
76
 
71
77
  BetaPermissionError = Anthropic::Models::BetaPermissionError
@@ -779,6 +785,11 @@ module Anthropic
779
785
 
780
786
  PlainTextSource = Anthropic::Models::PlainTextSource
781
787
 
788
+ RampLimitExceededError = Anthropic::Models::RampLimitExceededError
789
+
790
+ RampLimitExceededErrorDetails =
791
+ Anthropic::Models::RampLimitExceededErrorDetails
792
+
782
793
  RateLimitError = Anthropic::Models::RateLimitError
783
794
 
784
795
  RawContentBlockDelta = Anthropic::Models::RawContentBlockDelta
@@ -97,6 +97,49 @@ module Anthropic
97
97
  )
98
98
  end
99
99
 
100
+ # Sign a member out of Claude everywhere, without removing them from the
101
+ # organization. This ends their sign-in sessions and removes their trusted devices
102
+ # wherever they use Claude, including other organizations and individual plans. It
103
+ # also ends the OAuth tokens issued to them for this organization, so apps such as
104
+ # Claude Code must sign in again.
105
+ #
106
+ # A token can take up to an hour to stop working, though it almost always stops at
107
+ # once. The member keeps their role and can sign in again right away. To keep them
108
+ # out, remove them from the organization or, if your organization uses single
109
+ # sign-on, block them in your identity provider. Signing out does not end API
110
+ # keys, OAuth tokens that were not issued for this organization, or the member's
111
+ # Claude Code cloud sessions and routines.
112
+ #
113
+ # You cannot sign out the organization's primary owner or the person your API key
114
+ # or token acts for, and a request to sign out another owner, a member with owner
115
+ # permissions, or a membership admin may be refused. A refused request returns a
116
+ # `400` or `403` error that says why. If the request returns `503`, send it again
117
+ # to finish; anything already ended stays ended.
118
+ #
119
+ # Every request must include the beta header
120
+ # `anthropic-beta: admin-user-sign-out-2026-10-08`. A request without it returns
121
+ # `400`. Sign-out is in beta. Anthropic turns it on for each organization and has
122
+ # turned it on for every Claude Enterprise organization; until yours is on,
123
+ # requests also return `400`. In a Claude Enterprise organization, an API key
124
+ # needs the `write:members` scope; a key without it gets `403`.
125
+ sig do
126
+ params(
127
+ user_id: String,
128
+ betas:
129
+ T::Array[T.any(Anthropic::AnthropicBeta::OrSymbol, String)],
130
+ request_options: Anthropic::RequestOptions::OrHash
131
+ ).returns(Anthropic::Beta::Organization::BetaOrganizationUser)
132
+ end
133
+ def sign_out(
134
+ # ID of the User.
135
+ user_id,
136
+ # This endpoint is in beta: requests must send `admin-user-sign-out-2026-10-08` in
137
+ # this header.
138
+ betas: nil,
139
+ request_options: {}
140
+ )
141
+ end
142
+
100
143
  # @api private
101
144
  sig { params(client: Anthropic::Client).returns(T.attached_class) }
102
145
  def self.new(client:)
@@ -164,5 +164,8 @@ module Anthropic
164
164
  class OverloadedError < Anthropic::Errors::InternalServerError
165
165
  HTTP_STATUS: 529
166
166
  end
167
+
168
+ class ConfigurationError < Anthropic::Errors::Error
169
+ end
167
170
  end
168
171
  end
@@ -262,6 +262,7 @@ module Anthropic
262
262
  TUNNELS_CERTIFICATES_RETRIEVE: "anthropic.tunnels.certificates.retrieve"
263
263
  TUNNELS_CERTIFICATES_LIST: "anthropic.tunnels.certificates.list"
264
264
  TUNNELS_CERTIFICATES_ARCHIVE: "anthropic.tunnels.certificates.archive"
265
+ ORGANIZATION_USERS_SIGN_OUT: "anthropic.organization.users.sign_out"
265
266
  ORGANIZATION_ANALYTICS_USAGE_LIST: "anthropic.organization.analytics.usage.list"
266
267
  ORGANIZATION_ANALYTICS_COST_LIST: "anthropic.organization.analytics.cost.list"
267
268
  ORGANIZATION_ANALYTICS_USAGE_REPORT_LIST: "anthropic.organization.analytics.usage_report.list"
@@ -53,6 +53,7 @@ module Anthropic
53
53
  | :"spend-limit-reads-2026-09-26"
54
54
  | :"telemetry-destinations-2026-08-11"
55
55
  | :"webhooks-2026-10-07"
56
+ | :"admin-user-sign-out-2026-10-08"
56
57
  | :"message-threads-2026-08-12"
57
58
  | :"analytics-usage-cost-2026-08-24"
58
59
  | :"experimental-claude-tag-2026-10-21"
@@ -115,6 +116,7 @@ module Anthropic
115
116
  SPEND_LIMIT_READS_2026_09_26: :"spend-limit-reads-2026-09-26"
116
117
  TELEMETRY_DESTINATIONS_2026_08_11: :"telemetry-destinations-2026-08-11"
117
118
  WEBHOOKS_2026_10_07: :"webhooks-2026-10-07"
119
+ ADMIN_USER_SIGN_OUT_2026_10_08: :"admin-user-sign-out-2026-10-08"
118
120
  MESSAGE_THREADS_2026_08_12: :"message-threads-2026-08-12"
119
121
  ANALYTICS_USAGE_COST_2026_08_24: :"analytics-usage-cost-2026-08-24"
120
122
  EXPERIMENTAL_CLAUDE_TAG_2026_10_21: :"experimental-claude-tag-2026-10-21"
@@ -0,0 +1,13 @@
1
+ module Anthropic
2
+ module Models
3
+ module Beta
4
+ module Organization
5
+ class BetaCannotSignOutManagedMemberError < Anthropic::Errors::PermissionDeniedError
6
+ def error_code: -> :cannot_sign_out_managed_member
7
+
8
+ def details: -> Anthropic::Beta::Organization::BetaCannotSignOutManagedMemberErrorDetails
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,18 @@
1
+ module Anthropic
2
+ module Models
3
+ module Beta
4
+ module Organization
5
+ type beta_cannot_sign_out_managed_member_error_details =
6
+ { error_code: :cannot_sign_out_managed_member }
7
+
8
+ class BetaCannotSignOutManagedMemberErrorDetails < Anthropic::Internal::Type::BaseModel
9
+ attr_accessor error_code: :cannot_sign_out_managed_member
10
+
11
+ def initialize: (?error_code: :cannot_sign_out_managed_member) -> void
12
+
13
+ def to_hash: -> { error_code: :cannot_sign_out_managed_member }
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ module Anthropic
2
+ module Models
3
+ module Beta
4
+ module Organization
5
+ class BetaCannotSignOutMembershipAdminError < Anthropic::Errors::PermissionDeniedError
6
+ def error_code: -> :cannot_sign_out_membership_admin
7
+
8
+ def details: -> Anthropic::Beta::Organization::BetaCannotSignOutMembershipAdminErrorDetails
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ module Anthropic
2
+ module Models
3
+ module Beta
4
+ module Organization
5
+ type beta_cannot_sign_out_membership_admin_error_details =
6
+ { error_code: :cannot_sign_out_membership_admin }
7
+
8
+ class BetaCannotSignOutMembershipAdminErrorDetails < Anthropic::Internal::Type::BaseModel
9
+ attr_accessor error_code: :cannot_sign_out_membership_admin
10
+
11
+ def initialize: (
12
+ ?error_code: :cannot_sign_out_membership_admin
13
+ ) -> void
14
+
15
+ def to_hash: -> { error_code: :cannot_sign_out_membership_admin }
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ module Anthropic
2
+ module Models
3
+ module Beta
4
+ module Organization
5
+ class BetaCannotSignOutOwnerError < Anthropic::Errors::PermissionDeniedError
6
+ def error_code: -> :cannot_sign_out_owner
7
+
8
+ def details: -> Anthropic::Beta::Organization::BetaCannotSignOutOwnerErrorDetails
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,18 @@
1
+ module Anthropic
2
+ module Models
3
+ module Beta
4
+ module Organization
5
+ type beta_cannot_sign_out_owner_error_details =
6
+ { error_code: :cannot_sign_out_owner }
7
+
8
+ class BetaCannotSignOutOwnerErrorDetails < Anthropic::Internal::Type::BaseModel
9
+ attr_accessor error_code: :cannot_sign_out_owner
10
+
11
+ def initialize: (?error_code: :cannot_sign_out_owner) -> void
12
+
13
+ def to_hash: -> { error_code: :cannot_sign_out_owner }
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ module Anthropic
2
+ module Models
3
+ module Beta
4
+ module Organization
5
+ class BetaCannotSignOutPrimaryOwnerError < Anthropic::Errors::BadRequestError
6
+ def error_code: -> :cannot_sign_out_primary_owner
7
+
8
+ def details: -> Anthropic::Beta::Organization::BetaCannotSignOutPrimaryOwnerErrorDetails
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end