anthropic 1.45.0 → 1.47.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 (146) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/helpers/streaming/message_stream.rb +4 -0
  5. data/lib/anthropic/models/anthropic_beta.rb +6 -0
  6. data/lib/anthropic/models/beta/agent_create_params.rb +8 -8
  7. data/lib/anthropic/models/beta/agent_update_params.rb +7 -10
  8. data/lib/anthropic/models/beta/beta_advisor_tool_20260301.rb +15 -1
  9. data/lib/anthropic/models/beta/beta_advisor_tool_result_error.rb +1 -0
  10. data/lib/anthropic/models/beta/beta_advisor_tool_result_error_param.rb +1 -0
  11. data/lib/anthropic/models/beta/beta_content_block.rb +14 -1
  12. data/lib/anthropic/models/beta/beta_content_block_param.rb +18 -1
  13. data/lib/anthropic/models/beta/beta_fallback_block.rb +54 -0
  14. data/lib/anthropic/models/beta/beta_fallback_block_param.rb +51 -0
  15. data/lib/anthropic/models/beta/beta_fallback_info.rb +28 -0
  16. data/lib/anthropic/models/beta/beta_fallback_info_param.rb +28 -0
  17. data/lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb +81 -0
  18. data/lib/anthropic/models/beta/beta_fallback_param.rb +88 -0
  19. data/lib/anthropic/models/beta/beta_iterations_usage.rb +9 -1
  20. data/lib/anthropic/models/beta/beta_managed_agents_custom_tool_input_schema.rb +10 -27
  21. data/lib/anthropic/models/beta/beta_managed_agents_model.rb +5 -0
  22. data/lib/anthropic/models/beta/beta_message.rb +2 -2
  23. data/lib/anthropic/models/beta/beta_message_delta_usage.rb +2 -2
  24. data/lib/anthropic/models/beta/beta_message_iteration_usage.rb +15 -1
  25. data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
  26. data/lib/anthropic/models/beta/beta_model_info.rb +11 -1
  27. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +16 -3
  28. data/lib/anthropic/models/beta/beta_refusal_stop_details.rb +64 -1
  29. data/lib/anthropic/models/beta/beta_tool_search_tool_result_error_param.rb +7 -1
  30. data/lib/anthropic/models/beta/beta_usage.rb +2 -2
  31. data/lib/anthropic/models/beta/beta_webhook_session_archived_event_data.rb +2 -2
  32. data/lib/anthropic/models/beta/beta_webhook_session_created_event_data.rb +2 -2
  33. data/lib/anthropic/models/beta/beta_webhook_session_deleted_event_data.rb +2 -2
  34. data/lib/anthropic/models/beta/beta_webhook_session_idled_event_data.rb +2 -2
  35. data/lib/anthropic/models/beta/beta_webhook_session_outcome_evaluation_ended_event_data.rb +2 -2
  36. data/lib/anthropic/models/beta/beta_webhook_session_pending_event_data.rb +2 -2
  37. data/lib/anthropic/models/beta/beta_webhook_session_requires_action_event_data.rb +2 -2
  38. data/lib/anthropic/models/beta/beta_webhook_session_running_event_data.rb +2 -2
  39. data/lib/anthropic/models/beta/beta_webhook_session_status_idled_event_data.rb +2 -2
  40. data/lib/anthropic/models/beta/beta_webhook_session_status_rescheduled_event_data.rb +2 -2
  41. data/lib/anthropic/models/beta/beta_webhook_session_status_run_started_event_data.rb +2 -2
  42. data/lib/anthropic/models/beta/beta_webhook_session_status_terminated_event_data.rb +2 -2
  43. data/lib/anthropic/models/beta/beta_webhook_session_thread_created_event_data.rb +2 -2
  44. data/lib/anthropic/models/beta/beta_webhook_session_thread_idled_event_data.rb +2 -2
  45. data/lib/anthropic/models/beta/beta_webhook_session_thread_terminated_event_data.rb +2 -2
  46. data/lib/anthropic/models/beta/beta_webhook_vault_archived_event_data.rb +2 -2
  47. data/lib/anthropic/models/beta/beta_webhook_vault_created_event_data.rb +2 -2
  48. data/lib/anthropic/models/beta/beta_webhook_vault_credential_archived_event_data.rb +2 -2
  49. data/lib/anthropic/models/beta/beta_webhook_vault_credential_created_event_data.rb +2 -2
  50. data/lib/anthropic/models/beta/beta_webhook_vault_credential_deleted_event_data.rb +2 -2
  51. data/lib/anthropic/models/beta/beta_webhook_vault_credential_refresh_failed_event_data.rb +2 -2
  52. data/lib/anthropic/models/beta/beta_webhook_vault_deleted_event_data.rb +2 -2
  53. data/lib/anthropic/models/beta/message_create_params.rb +39 -1
  54. data/lib/anthropic/models/beta/messages/batch_create_params.rb +39 -1
  55. data/lib/anthropic/models/beta/session_list_params.rb +2 -2
  56. data/lib/anthropic/models/model.rb +13 -0
  57. data/lib/anthropic/models/refusal_stop_details.rb +1 -0
  58. data/lib/anthropic/models/tool_search_tool_result_error_param.rb +7 -1
  59. data/lib/anthropic/resources/beta/agents.rb +7 -7
  60. data/lib/anthropic/resources/beta/messages.rb +10 -2
  61. data/lib/anthropic/resources/beta/sessions.rb +1 -1
  62. data/lib/anthropic/version.rb +1 -1
  63. data/lib/anthropic.rb +6 -0
  64. data/rbi/anthropic/models/anthropic_beta.rbi +10 -0
  65. data/rbi/anthropic/models/beta/agent_create_params.rbi +8 -8
  66. data/rbi/anthropic/models/beta/agent_update_params.rbi +6 -12
  67. data/rbi/anthropic/models/beta/beta_advisor_tool_20260301.rbi +20 -0
  68. data/rbi/anthropic/models/beta/beta_advisor_tool_result_error.rbi +5 -0
  69. data/rbi/anthropic/models/beta/beta_advisor_tool_result_error_param.rbi +5 -0
  70. data/rbi/anthropic/models/beta/beta_content_block.rbi +2 -1
  71. data/rbi/anthropic/models/beta/beta_content_block_param.rbi +2 -1
  72. data/rbi/anthropic/models/beta/beta_fallback_block.rbi +83 -0
  73. data/rbi/anthropic/models/beta/beta_fallback_block_param.rbi +81 -0
  74. data/rbi/anthropic/models/beta/beta_fallback_info.rbi +45 -0
  75. data/rbi/anthropic/models/beta/beta_fallback_info_param.rbi +47 -0
  76. data/rbi/anthropic/models/beta/beta_fallback_message_iteration_usage.rbi +113 -0
  77. data/rbi/anthropic/models/beta/beta_fallback_param.rbi +167 -0
  78. data/rbi/anthropic/models/beta/beta_iterations_usage.rbi +2 -1
  79. data/rbi/anthropic/models/beta/beta_managed_agents_custom_tool_input_schema.rbi +9 -68
  80. data/rbi/anthropic/models/beta/beta_managed_agents_model.rbi +7 -0
  81. data/rbi/anthropic/models/beta/beta_message.rbi +2 -1
  82. data/rbi/anthropic/models/beta/beta_message_delta_usage.rbi +2 -1
  83. data/rbi/anthropic/models/beta/beta_message_iteration_usage.rbi +14 -0
  84. data/rbi/anthropic/models/beta/beta_model_info.rbi +12 -0
  85. data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +4 -2
  86. data/rbi/anthropic/models/beta/beta_refusal_stop_details.rbi +105 -0
  87. data/rbi/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbi +11 -2
  88. data/rbi/anthropic/models/beta/beta_usage.rbi +2 -1
  89. data/rbi/anthropic/models/beta/beta_webhook_session_archived_event_data.rbi +2 -2
  90. data/rbi/anthropic/models/beta/beta_webhook_session_created_event_data.rbi +2 -2
  91. data/rbi/anthropic/models/beta/beta_webhook_session_deleted_event_data.rbi +2 -2
  92. data/rbi/anthropic/models/beta/beta_webhook_session_idled_event_data.rbi +2 -2
  93. data/rbi/anthropic/models/beta/beta_webhook_session_outcome_evaluation_ended_event_data.rbi +2 -2
  94. data/rbi/anthropic/models/beta/beta_webhook_session_pending_event_data.rbi +2 -2
  95. data/rbi/anthropic/models/beta/beta_webhook_session_requires_action_event_data.rbi +2 -2
  96. data/rbi/anthropic/models/beta/beta_webhook_session_running_event_data.rbi +2 -2
  97. data/rbi/anthropic/models/beta/beta_webhook_session_status_idled_event_data.rbi +2 -2
  98. data/rbi/anthropic/models/beta/beta_webhook_session_status_rescheduled_event_data.rbi +2 -2
  99. data/rbi/anthropic/models/beta/beta_webhook_session_status_run_started_event_data.rbi +2 -2
  100. data/rbi/anthropic/models/beta/beta_webhook_session_status_terminated_event_data.rbi +2 -2
  101. data/rbi/anthropic/models/beta/beta_webhook_session_thread_created_event_data.rbi +2 -2
  102. data/rbi/anthropic/models/beta/beta_webhook_session_thread_idled_event_data.rbi +2 -2
  103. data/rbi/anthropic/models/beta/beta_webhook_session_thread_terminated_event_data.rbi +2 -2
  104. data/rbi/anthropic/models/beta/beta_webhook_vault_archived_event_data.rbi +2 -2
  105. data/rbi/anthropic/models/beta/beta_webhook_vault_created_event_data.rbi +2 -2
  106. data/rbi/anthropic/models/beta/beta_webhook_vault_credential_archived_event_data.rbi +2 -2
  107. data/rbi/anthropic/models/beta/beta_webhook_vault_credential_created_event_data.rbi +2 -2
  108. data/rbi/anthropic/models/beta/beta_webhook_vault_credential_deleted_event_data.rbi +2 -2
  109. data/rbi/anthropic/models/beta/beta_webhook_vault_credential_refresh_failed_event_data.rbi +2 -2
  110. data/rbi/anthropic/models/beta/beta_webhook_vault_deleted_event_data.rbi +2 -2
  111. data/rbi/anthropic/models/beta/message_create_params.rbi +58 -0
  112. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +62 -0
  113. data/rbi/anthropic/models/beta/session_list_params.rbi +2 -2
  114. data/rbi/anthropic/models/model.rbi +7 -0
  115. data/rbi/anthropic/models/refusal_stop_details.rbi +5 -0
  116. data/rbi/anthropic/models/tool_search_tool_result_error_param.rbi +11 -2
  117. data/rbi/anthropic/resources/beta/agents.rbi +8 -10
  118. data/rbi/anthropic/resources/beta/messages.rbi +54 -0
  119. data/rbi/anthropic/resources/beta/sessions.rbi +1 -1
  120. data/sig/anthropic/models/anthropic_beta.rbs +4 -0
  121. data/sig/anthropic/models/beta/beta_advisor_tool_20260301.rbs +5 -0
  122. data/sig/anthropic/models/beta/beta_advisor_tool_result_error.rbs +2 -0
  123. data/sig/anthropic/models/beta/beta_advisor_tool_result_error_param.rbs +2 -0
  124. data/sig/anthropic/models/beta/beta_content_block.rbs +1 -0
  125. data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
  126. data/sig/anthropic/models/beta/beta_fallback_block.rbs +34 -0
  127. data/sig/anthropic/models/beta/beta_fallback_block_param.rbs +34 -0
  128. data/sig/anthropic/models/beta/beta_fallback_info.rbs +17 -0
  129. data/sig/anthropic/models/beta/beta_fallback_info_param.rbs +17 -0
  130. data/sig/anthropic/models/beta/beta_fallback_message_iteration_usage.rbs +54 -0
  131. data/sig/anthropic/models/beta/beta_fallback_param.rbs +66 -0
  132. data/sig/anthropic/models/beta/beta_iterations_usage.rbs +1 -0
  133. data/sig/anthropic/models/beta/beta_managed_agents_custom_tool_input_schema.rbs +9 -25
  134. data/sig/anthropic/models/beta/beta_managed_agents_model.rbs +5 -1
  135. data/sig/anthropic/models/beta/beta_message_iteration_usage.rbs +5 -0
  136. data/sig/anthropic/models/beta/beta_model_info.rbs +5 -0
  137. data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +1 -0
  138. data/sig/anthropic/models/beta/beta_refusal_stop_details.rbs +17 -1
  139. data/sig/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbs +7 -2
  140. data/sig/anthropic/models/beta/message_create_params.rbs +10 -0
  141. data/sig/anthropic/models/beta/messages/batch_create_params.rbs +10 -0
  142. data/sig/anthropic/models/model.rbs +9 -1
  143. data/sig/anthropic/models/refusal_stop_details.rbs +2 -1
  144. data/sig/anthropic/models/tool_search_tool_result_error_param.rbs +7 -2
  145. data/sig/anthropic/resources/beta/messages.rbs +4 -0
  146. metadata +20 -2
@@ -330,6 +330,9 @@ module Anthropic
330
330
  T.nilable(Anthropic::Beta::BetaContextManagementConfig::OrHash),
331
331
  diagnostics:
332
332
  T.nilable(Anthropic::Beta::BetaDiagnosticsParam::OrHash),
333
+ fallback_credit_token: T.nilable(String),
334
+ fallbacks:
335
+ T.nilable(T::Array[Anthropic::Beta::BetaFallbackParam::OrHash]),
333
336
  inference_geo: T.nilable(String),
334
337
  mcp_servers:
335
338
  T::Array[
@@ -492,6 +495,30 @@ module Anthropic
492
495
  # Body param: Request-level diagnostics. Currently carries the previous response
493
496
  # id for prompt-cache divergence reporting.
494
497
  diagnostics: nil,
498
+ # Body param: The `fallback_credit_token` from a prior refusal's `stop_details`.
499
+ #
500
+ # When a preceding request was refused and returned a `fallback_credit_token`,
501
+ # pass that code here on the retry to have the retry's cache-creation tokens for
502
+ # the prefix that was warm on the refused model billed at the cache-read rate.
503
+ # Must be redeemed by the same organization and workspace, with the same request
504
+ # body (optionally extended by one appended `assistant` message whose content is
505
+ # the partial text — with any trailing whitespace stripped from the final text
506
+ # block — and paired server-tool blocks streamed before the refusal; the
507
+ # appended-assistant form is not available for requests with `output_format` set
508
+ # or forced `tool_choice`), on an eligible fallback model, on the same platform,
509
+ # and within 5 minutes of the refusal; a mismatch is a 400. A token minted
510
+ # mid-server-tool-loop whose partial content was continuable may only be redeemed
511
+ # with the appended-assistant form — if an exact-body retry is rejected with a 400
512
+ # saying the token must be redeemed by continuing the partial response, retry with
513
+ # the appended-assistant form instead.
514
+ #
515
+ # When the appended-assistant form is used on a model that otherwise disallows
516
+ # assistant-turn prefill, this token also authorizes that one prefill.
517
+ fallback_credit_token: nil,
518
+ # Body param: Opt-in server-side retry on one or more substitute models when the
519
+ # requested model declines for policy reasons. Tried in order: if the first entry
520
+ # also declines, the second is tried, and so on.
521
+ fallbacks: nil,
495
522
  # Body param: Specifies the geographic region for inference processing. If not
496
523
  # specified, the workspace's `default_inference_geo` is used.
497
524
  inference_geo: nil,
@@ -683,6 +710,9 @@ module Anthropic
683
710
  T.nilable(Anthropic::Beta::BetaContextManagementConfig::OrHash),
684
711
  diagnostics:
685
712
  T.nilable(Anthropic::Beta::BetaDiagnosticsParam::OrHash),
713
+ fallback_credit_token: T.nilable(String),
714
+ fallbacks:
715
+ T.nilable(T::Array[Anthropic::Beta::BetaFallbackParam::OrHash]),
686
716
  inference_geo: T.nilable(String),
687
717
  mcp_servers:
688
718
  T::Array[
@@ -849,6 +879,30 @@ module Anthropic
849
879
  # Body param: Request-level diagnostics. Currently carries the previous response
850
880
  # id for prompt-cache divergence reporting.
851
881
  diagnostics: nil,
882
+ # Body param: The `fallback_credit_token` from a prior refusal's `stop_details`.
883
+ #
884
+ # When a preceding request was refused and returned a `fallback_credit_token`,
885
+ # pass that code here on the retry to have the retry's cache-creation tokens for
886
+ # the prefix that was warm on the refused model billed at the cache-read rate.
887
+ # Must be redeemed by the same organization and workspace, with the same request
888
+ # body (optionally extended by one appended `assistant` message whose content is
889
+ # the partial text — with any trailing whitespace stripped from the final text
890
+ # block — and paired server-tool blocks streamed before the refusal; the
891
+ # appended-assistant form is not available for requests with `output_format` set
892
+ # or forced `tool_choice`), on an eligible fallback model, on the same platform,
893
+ # and within 5 minutes of the refusal; a mismatch is a 400. A token minted
894
+ # mid-server-tool-loop whose partial content was continuable may only be redeemed
895
+ # with the appended-assistant form — if an exact-body retry is rejected with a 400
896
+ # saying the token must be redeemed by continuing the partial response, retry with
897
+ # the appended-assistant form instead.
898
+ #
899
+ # When the appended-assistant form is used on a model that otherwise disallows
900
+ # assistant-turn prefill, this token also authorizes that one prefill.
901
+ fallback_credit_token: nil,
902
+ # Body param: Opt-in server-side retry on one or more substitute models when the
903
+ # requested model declines for policy reasons. Tried in order: if the first entry
904
+ # also declines, the second is tried, and so on.
905
+ fallbacks: nil,
852
906
  # Body param: Specifies the geographic region for inference processing. If not
853
907
  # specified, the workspace's `default_inference_geo` is used.
854
908
  inference_geo: nil,
@@ -161,7 +161,7 @@ module Anthropic
161
161
  # Query param: Sort direction for results, ordered by created_at. Defaults to desc
162
162
  # (newest first).
163
163
  order: nil,
164
- # Query param: Opaque pagination cursor from a previous response's next_page.
164
+ # Query param: Opaque pagination cursor from a previous response.
165
165
  page: nil,
166
166
  # Query param: Filter by session status. Repeat the parameter to match any of
167
167
  # multiple statuses.
@@ -28,6 +28,8 @@ module Anthropic
28
28
  | :"managed-agents-2026-04-01"
29
29
  | :"cache-diagnosis-2026-04-07"
30
30
  | :"thinking-token-count-2026-05-13"
31
+ | :"server-side-fallback-2026-06-01"
32
+ | :"fallback-credit-2026-06-01"
31
33
 
32
34
  module AnthropicBeta
33
35
  extend Anthropic::Internal::Type::Union
@@ -60,6 +62,8 @@ module Anthropic
60
62
  MANAGED_AGENTS_2026_04_01: :"managed-agents-2026-04-01"
61
63
  CACHE_DIAGNOSIS_2026_04_07: :"cache-diagnosis-2026-04-07"
62
64
  THINKING_TOKEN_COUNT_2026_05_13: :"thinking-token-count-2026-05-13"
65
+ SERVER_SIDE_FALLBACK_2026_06_01: :"server-side-fallback-2026-06-01"
66
+ FALLBACK_CREDIT_2026_06_01: :"fallback-credit-2026-06-01"
63
67
  end
64
68
  end
65
69
  end
@@ -12,6 +12,7 @@ module Anthropic
12
12
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
13
13
  caching: Anthropic::Beta::BetaCacheControlEphemeral?,
14
14
  defer_loading: bool,
15
+ max_tokens: Integer?,
15
16
  max_uses: Integer?,
16
17
  strict: bool
17
18
  }
@@ -37,6 +38,8 @@ module Anthropic
37
38
 
38
39
  def defer_loading=: (bool) -> bool
39
40
 
41
+ attr_accessor max_tokens: Integer?
42
+
40
43
  attr_accessor max_uses: Integer?
41
44
 
42
45
  attr_reader strict: bool?
@@ -49,6 +52,7 @@ module Anthropic
49
52
  ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
50
53
  ?caching: Anthropic::Beta::BetaCacheControlEphemeral?,
51
54
  ?defer_loading: bool,
55
+ ?max_tokens: Integer?,
52
56
  ?max_uses: Integer?,
53
57
  ?strict: bool,
54
58
  ?name: :advisor,
@@ -63,6 +67,7 @@ module Anthropic
63
67
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
64
68
  caching: Anthropic::Beta::BetaCacheControlEphemeral?,
65
69
  defer_loading: bool,
70
+ max_tokens: Integer?,
66
71
  max_uses: Integer?,
67
72
  strict: bool
68
73
  }
@@ -31,6 +31,7 @@ module Anthropic
31
31
  | :overloaded
32
32
  | :unavailable
33
33
  | :execution_time_exceeded
34
+ | :model_not_found
34
35
 
35
36
  module ErrorCode
36
37
  extend Anthropic::Internal::Type::Enum
@@ -41,6 +42,7 @@ module Anthropic
41
42
  OVERLOADED: :overloaded
42
43
  UNAVAILABLE: :unavailable
43
44
  EXECUTION_TIME_EXCEEDED: :execution_time_exceeded
45
+ MODEL_NOT_FOUND: :model_not_found
44
46
 
45
47
  def self?.values: -> ::Array[Anthropic::Models::Beta::BetaAdvisorToolResultError::error_code]
46
48
  end
@@ -31,6 +31,7 @@ module Anthropic
31
31
  | :overloaded
32
32
  | :unavailable
33
33
  | :execution_time_exceeded
34
+ | :model_not_found
34
35
 
35
36
  module ErrorCode
36
37
  extend Anthropic::Internal::Type::Enum
@@ -41,6 +42,7 @@ module Anthropic
41
42
  OVERLOADED: :overloaded
42
43
  UNAVAILABLE: :unavailable
43
44
  EXECUTION_TIME_EXCEEDED: :execution_time_exceeded
45
+ MODEL_NOT_FOUND: :model_not_found
44
46
 
45
47
  def self?.values: -> ::Array[Anthropic::Models::Beta::BetaAdvisorToolResultErrorParam::error_code]
46
48
  end
@@ -20,6 +20,7 @@ module Anthropic
20
20
  | Anthropic::Beta::BetaMCPToolResultBlock
21
21
  | Anthropic::Beta::BetaContainerUploadBlock
22
22
  | Anthropic::Beta::BetaCompactionBlock
23
+ | Anthropic::Beta::BetaFallbackBlock
23
24
 
24
25
  module BetaContentBlock
25
26
  extend Anthropic::Internal::Type::Union
@@ -25,6 +25,7 @@ module Anthropic
25
25
  | Anthropic::Beta::BetaContainerUploadBlockParam
26
26
  | Anthropic::Beta::BetaCompactionBlockParam
27
27
  | Anthropic::Beta::BetaMidConversationSystemBlockParam
28
+ | Anthropic::Beta::BetaFallbackBlockParam
28
29
 
29
30
  module BetaContentBlockParam
30
31
  extend Anthropic::Internal::Type::Union
@@ -0,0 +1,34 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaFallbackBlock = Beta::BetaFallbackBlock
4
+
5
+ module Beta
6
+ type beta_fallback_block =
7
+ {
8
+ from: Anthropic::Beta::BetaFallbackInfo,
9
+ to: Anthropic::Beta::BetaFallbackInfo,
10
+ type: :fallback
11
+ }
12
+
13
+ class BetaFallbackBlock < Anthropic::Internal::Type::BaseModel
14
+ attr_accessor from: Anthropic::Beta::BetaFallbackInfo
15
+
16
+ attr_accessor to: Anthropic::Beta::BetaFallbackInfo
17
+
18
+ attr_accessor type: :fallback
19
+
20
+ def initialize: (
21
+ from: Anthropic::Beta::BetaFallbackInfo,
22
+ to: Anthropic::Beta::BetaFallbackInfo,
23
+ ?type: :fallback
24
+ ) -> void
25
+
26
+ def to_hash: -> {
27
+ from: Anthropic::Beta::BetaFallbackInfo,
28
+ to: Anthropic::Beta::BetaFallbackInfo,
29
+ type: :fallback
30
+ }
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaFallbackBlockParam = Beta::BetaFallbackBlockParam
4
+
5
+ module Beta
6
+ type beta_fallback_block_param =
7
+ {
8
+ from: Anthropic::Beta::BetaFallbackInfoParam,
9
+ to: Anthropic::Beta::BetaFallbackInfoParam,
10
+ type: :fallback
11
+ }
12
+
13
+ class BetaFallbackBlockParam < Anthropic::Internal::Type::BaseModel
14
+ attr_accessor from: Anthropic::Beta::BetaFallbackInfoParam
15
+
16
+ attr_accessor to: Anthropic::Beta::BetaFallbackInfoParam
17
+
18
+ attr_accessor type: :fallback
19
+
20
+ def initialize: (
21
+ from: Anthropic::Beta::BetaFallbackInfoParam,
22
+ to: Anthropic::Beta::BetaFallbackInfoParam,
23
+ ?type: :fallback
24
+ ) -> void
25
+
26
+ def to_hash: -> {
27
+ from: Anthropic::Beta::BetaFallbackInfoParam,
28
+ to: Anthropic::Beta::BetaFallbackInfoParam,
29
+ type: :fallback
30
+ }
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,17 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaFallbackInfo = Beta::BetaFallbackInfo
4
+
5
+ module Beta
6
+ type beta_fallback_info = { model: Anthropic::Models::model }
7
+
8
+ class BetaFallbackInfo < Anthropic::Internal::Type::BaseModel
9
+ attr_accessor model: Anthropic::Models::model
10
+
11
+ def initialize: (model: Anthropic::Models::model) -> void
12
+
13
+ def to_hash: -> { model: Anthropic::Models::model }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaFallbackInfoParam = Beta::BetaFallbackInfoParam
4
+
5
+ module Beta
6
+ type beta_fallback_info_param = { model: Anthropic::Models::model }
7
+
8
+ class BetaFallbackInfoParam < Anthropic::Internal::Type::BaseModel
9
+ attr_accessor model: Anthropic::Models::model
10
+
11
+ def initialize: (model: Anthropic::Models::model) -> void
12
+
13
+ def to_hash: -> { model: Anthropic::Models::model }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,54 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaFallbackMessageIterationUsage = Beta::BetaFallbackMessageIterationUsage
4
+
5
+ module Beta
6
+ type beta_fallback_message_iteration_usage =
7
+ {
8
+ cache_creation: Anthropic::Beta::BetaCacheCreation?,
9
+ cache_creation_input_tokens: Integer,
10
+ cache_read_input_tokens: Integer,
11
+ input_tokens: Integer,
12
+ model: Anthropic::Models::model,
13
+ output_tokens: Integer,
14
+ type: :fallback_message
15
+ }
16
+
17
+ class BetaFallbackMessageIterationUsage < Anthropic::Internal::Type::BaseModel
18
+ attr_accessor cache_creation: Anthropic::Beta::BetaCacheCreation?
19
+
20
+ attr_accessor cache_creation_input_tokens: Integer
21
+
22
+ attr_accessor cache_read_input_tokens: Integer
23
+
24
+ attr_accessor input_tokens: Integer
25
+
26
+ attr_accessor model: Anthropic::Models::model
27
+
28
+ attr_accessor output_tokens: Integer
29
+
30
+ attr_accessor type: :fallback_message
31
+
32
+ def initialize: (
33
+ cache_creation: Anthropic::Beta::BetaCacheCreation?,
34
+ cache_creation_input_tokens: Integer,
35
+ cache_read_input_tokens: Integer,
36
+ input_tokens: Integer,
37
+ model: Anthropic::Models::model,
38
+ output_tokens: Integer,
39
+ ?type: :fallback_message
40
+ ) -> void
41
+
42
+ def to_hash: -> {
43
+ cache_creation: Anthropic::Beta::BetaCacheCreation?,
44
+ cache_creation_input_tokens: Integer,
45
+ cache_read_input_tokens: Integer,
46
+ input_tokens: Integer,
47
+ model: Anthropic::Models::model,
48
+ output_tokens: Integer,
49
+ type: :fallback_message
50
+ }
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,66 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaFallbackParam = Beta::BetaFallbackParam
4
+
5
+ module Beta
6
+ type beta_fallback_param =
7
+ {
8
+ model: Anthropic::Models::model,
9
+ max_tokens: Integer?,
10
+ output_config: Anthropic::Beta::BetaOutputConfig?,
11
+ speed: Anthropic::Models::Beta::BetaFallbackParam::speed?,
12
+ thinking: Anthropic::Models::Beta::BetaFallbackParam::thinking?
13
+ }
14
+
15
+ class BetaFallbackParam < Anthropic::Internal::Type::BaseModel
16
+ attr_accessor model: Anthropic::Models::model
17
+
18
+ attr_accessor max_tokens: Integer?
19
+
20
+ attr_accessor output_config: Anthropic::Beta::BetaOutputConfig?
21
+
22
+ attr_accessor speed: Anthropic::Models::Beta::BetaFallbackParam::speed?
23
+
24
+ attr_accessor thinking: Anthropic::Models::Beta::BetaFallbackParam::thinking?
25
+
26
+ def initialize: (
27
+ model: Anthropic::Models::model,
28
+ ?max_tokens: Integer?,
29
+ ?output_config: Anthropic::Beta::BetaOutputConfig?,
30
+ ?speed: Anthropic::Models::Beta::BetaFallbackParam::speed?,
31
+ ?thinking: Anthropic::Models::Beta::BetaFallbackParam::thinking?
32
+ ) -> void
33
+
34
+ def to_hash: -> {
35
+ model: Anthropic::Models::model,
36
+ max_tokens: Integer?,
37
+ output_config: Anthropic::Beta::BetaOutputConfig?,
38
+ speed: Anthropic::Models::Beta::BetaFallbackParam::speed?,
39
+ thinking: Anthropic::Models::Beta::BetaFallbackParam::thinking?
40
+ }
41
+
42
+ type speed = :standard | :fast
43
+
44
+ module Speed
45
+ extend Anthropic::Internal::Type::Enum
46
+
47
+ STANDARD: :standard
48
+ FAST: :fast
49
+
50
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaFallbackParam::speed]
51
+ end
52
+
53
+ type thinking =
54
+ Anthropic::Beta::BetaThinkingConfigEnabled
55
+ | Anthropic::Beta::BetaThinkingConfigDisabled
56
+ | Anthropic::Beta::BetaThinkingConfigAdaptive
57
+
58
+ module Thinking
59
+ extend Anthropic::Internal::Type::Union
60
+
61
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaFallbackParam::thinking]
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -7,6 +7,7 @@ module Anthropic
7
7
  Anthropic::Beta::BetaMessageIterationUsage
8
8
  | Anthropic::Beta::BetaCompactionIterationUsage
9
9
  | Anthropic::Beta::BetaAdvisorMessageIterationUsage
10
+ | Anthropic::Beta::BetaFallbackMessageIterationUsage
10
11
 
11
12
  module BetaIterationsUsageItem
12
13
  extend Anthropic::Internal::Type::Union
@@ -5,45 +5,29 @@ module Anthropic
5
5
  module Beta
6
6
  type beta_managed_agents_custom_tool_input_schema =
7
7
  {
8
+ type: :object,
8
9
  properties: ::Hash[Symbol, top]?,
9
- required: ::Array[String],
10
- type: Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema::type_
10
+ required: ::Array[String]?
11
11
  }
12
12
 
13
13
  class BetaManagedAgentsCustomToolInputSchema < Anthropic::Internal::Type::BaseModel
14
- attr_accessor properties: ::Hash[Symbol, top]?
15
-
16
- attr_reader required: ::Array[String]?
14
+ attr_accessor type: :object
17
15
 
18
- def required=: (::Array[String]) -> ::Array[String]
19
-
20
- attr_reader type: Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema::type_?
16
+ attr_accessor properties: ::Hash[Symbol, top]?
21
17
 
22
- def type=: (
23
- Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema::type_
24
- ) -> Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema::type_
18
+ attr_accessor required: ::Array[String]?
25
19
 
26
20
  def initialize: (
27
21
  ?properties: ::Hash[Symbol, top]?,
28
- ?required: ::Array[String],
29
- ?type: Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema::type_
22
+ ?required: ::Array[String]?,
23
+ ?type: :object
30
24
  ) -> void
31
25
 
32
26
  def to_hash: -> {
27
+ type: :object,
33
28
  properties: ::Hash[Symbol, top]?,
34
- required: ::Array[String],
35
- type: Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema::type_
29
+ required: ::Array[String]?
36
30
  }
37
-
38
- type type_ = :object
39
-
40
- module Type
41
- extend Anthropic::Internal::Type::Enum
42
-
43
- OBJECT: :object
44
-
45
- def self?.values: -> ::Array[Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema::type_]
46
- end
47
31
  end
48
32
  end
49
33
  end
@@ -4,7 +4,8 @@ module Anthropic
4
4
 
5
5
  module Beta
6
6
  type beta_managed_agents_model =
7
- :"claude-opus-4-8"
7
+ :"claude-fable-5"
8
+ | :"claude-opus-4-8"
8
9
  | :"claude-opus-4-7"
9
10
  | :"claude-opus-4-6"
10
11
  | :"claude-sonnet-4-6"
@@ -21,6 +22,9 @@ module Anthropic
21
22
 
22
23
  def self?.variants: -> ::Array[Anthropic::Models::Beta::beta_managed_agents_model]
23
24
 
25
+ # Next generation of intelligence for the hardest knowledge work and coding problems
26
+ CLAUDE_FABLE_5: :"claude-fable-5"
27
+
24
28
  # Frontier intelligence for long-running agents and coding
25
29
  CLAUDE_OPUS_4_8: :"claude-opus-4-8"
26
30
 
@@ -9,6 +9,7 @@ module Anthropic
9
9
  cache_creation_input_tokens: Integer,
10
10
  cache_read_input_tokens: Integer,
11
11
  input_tokens: Integer,
12
+ model: Anthropic::Models::model,
12
13
  output_tokens: Integer,
13
14
  type: :message
14
15
  }
@@ -22,6 +23,8 @@ module Anthropic
22
23
 
23
24
  attr_accessor input_tokens: Integer
24
25
 
26
+ attr_accessor model: Anthropic::Models::model
27
+
25
28
  attr_accessor output_tokens: Integer
26
29
 
27
30
  attr_accessor type: :message
@@ -31,6 +34,7 @@ module Anthropic
31
34
  cache_creation_input_tokens: Integer,
32
35
  cache_read_input_tokens: Integer,
33
36
  input_tokens: Integer,
37
+ model: Anthropic::Models::model,
34
38
  output_tokens: Integer,
35
39
  ?type: :message
36
40
  ) -> void
@@ -40,6 +44,7 @@ module Anthropic
40
44
  cache_creation_input_tokens: Integer,
41
45
  cache_read_input_tokens: Integer,
42
46
  input_tokens: Integer,
47
+ model: Anthropic::Models::model,
43
48
  output_tokens: Integer,
44
49
  type: :message
45
50
  }
@@ -6,6 +6,7 @@ module Anthropic
6
6
  type beta_model_info =
7
7
  {
8
8
  id: String,
9
+ allowed_fallback_models: ::Array[String]?,
9
10
  capabilities: Anthropic::Beta::BetaModelCapabilities?,
10
11
  created_at: Time,
11
12
  display_name: String,
@@ -17,6 +18,8 @@ module Anthropic
17
18
  class BetaModelInfo < Anthropic::Internal::Type::BaseModel
18
19
  attr_accessor id: String
19
20
 
21
+ attr_accessor allowed_fallback_models: ::Array[String]?
22
+
20
23
  attr_accessor capabilities: Anthropic::Beta::BetaModelCapabilities?
21
24
 
22
25
  attr_accessor created_at: Time
@@ -31,6 +34,7 @@ module Anthropic
31
34
 
32
35
  def initialize: (
33
36
  id: String,
37
+ allowed_fallback_models: ::Array[String]?,
34
38
  capabilities: Anthropic::Beta::BetaModelCapabilities?,
35
39
  created_at: Time,
36
40
  display_name: String,
@@ -41,6 +45,7 @@ module Anthropic
41
45
 
42
46
  def to_hash: -> {
43
47
  id: String,
48
+ allowed_fallback_models: ::Array[String]?,
44
49
  capabilities: Anthropic::Beta::BetaModelCapabilities?,
45
50
  created_at: Time,
46
51
  display_name: String,
@@ -46,6 +46,7 @@ module Anthropic
46
46
  | Anthropic::Beta::BetaMCPToolResultBlock
47
47
  | Anthropic::Beta::BetaContainerUploadBlock
48
48
  | Anthropic::Beta::BetaCompactionBlock
49
+ | Anthropic::Beta::BetaFallbackBlock
49
50
 
50
51
  module ContentBlock
51
52
  extend Anthropic::Internal::Type::Union
@@ -7,6 +7,9 @@ module Anthropic
7
7
  {
8
8
  category: Anthropic::Models::Beta::BetaRefusalStopDetails::category?,
9
9
  explanation: String?,
10
+ fallback_credit_token: String?,
11
+ fallback_has_prefill_claim: bool?,
12
+ recommended_model: String?,
10
13
  type: :refusal
11
14
  }
12
15
 
@@ -15,27 +18,40 @@ module Anthropic
15
18
 
16
19
  attr_accessor explanation: String?
17
20
 
21
+ attr_accessor fallback_credit_token: String?
22
+
23
+ attr_accessor fallback_has_prefill_claim: bool?
24
+
25
+ attr_accessor recommended_model: String?
26
+
18
27
  attr_accessor type: :refusal
19
28
 
20
29
  def initialize: (
21
30
  category: Anthropic::Models::Beta::BetaRefusalStopDetails::category?,
22
31
  explanation: String?,
32
+ fallback_credit_token: String?,
33
+ fallback_has_prefill_claim: bool?,
34
+ recommended_model: String?,
23
35
  ?type: :refusal
24
36
  ) -> void
25
37
 
26
38
  def to_hash: -> {
27
39
  category: Anthropic::Models::Beta::BetaRefusalStopDetails::category?,
28
40
  explanation: String?,
41
+ fallback_credit_token: String?,
42
+ fallback_has_prefill_claim: bool?,
43
+ recommended_model: String?,
29
44
  type: :refusal
30
45
  }
31
46
 
32
- type category = :cyber | :bio
47
+ type category = :cyber | :bio | :reasoning_extraction
33
48
 
34
49
  module Category
35
50
  extend Anthropic::Internal::Type::Enum
36
51
 
37
52
  CYBER: :cyber
38
53
  BIO: :bio
54
+ REASONING_EXTRACTION: :reasoning_extraction
39
55
 
40
56
  def self?.values: -> ::Array[Anthropic::Models::Beta::BetaRefusalStopDetails::category]
41
57
  end
@@ -6,7 +6,8 @@ module Anthropic
6
6
  type beta_tool_search_tool_result_error_param =
7
7
  {
8
8
  error_code: Anthropic::Models::Beta::BetaToolSearchToolResultErrorParam::error_code,
9
- type: :tool_search_tool_result_error
9
+ type: :tool_search_tool_result_error,
10
+ error_message: String?
10
11
  }
11
12
 
12
13
  class BetaToolSearchToolResultErrorParam < Anthropic::Internal::Type::BaseModel
@@ -14,14 +15,18 @@ module Anthropic
14
15
 
15
16
  attr_accessor type: :tool_search_tool_result_error
16
17
 
18
+ attr_accessor error_message: String?
19
+
17
20
  def initialize: (
18
21
  error_code: Anthropic::Models::Beta::BetaToolSearchToolResultErrorParam::error_code,
22
+ ?error_message: String?,
19
23
  ?type: :tool_search_tool_result_error
20
24
  ) -> void
21
25
 
22
26
  def to_hash: -> {
23
27
  error_code: Anthropic::Models::Beta::BetaToolSearchToolResultErrorParam::error_code,
24
- type: :tool_search_tool_result_error
28
+ type: :tool_search_tool_result_error,
29
+ error_message: String?
25
30
  }
26
31
 
27
32
  type error_code =