Class BetaFallbackParam

  • All Implemented Interfaces:

    
    public final class BetaFallbackParam
    
                        

    One entry in the fallbacks chain on a /v1/messages request.

    model is required. The override fields (max_tokens, thinking, output_config, and speed) set the corresponding parameter for this attempt only and are validated as if the request were made to model. Any other key is rejected at parse time.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public final class BetaFallbackParam.Builder

      A builder for BetaFallbackParam.

      public final class BetaFallbackParam.Speed

      The inference speed mode for the fallback attempt that uses this fallbacks entry's model. If you leave it out, the attempt runs at fast speed only when the request sets speed to fast and your organization can use fast mode on model.

      Otherwise, or when you set this field to null, the attempt runs at standard speed.

      These rules apply with the server-side-fallback-2026-07-01 beta header.

      public final class BetaFallbackParam.Thinking

      The thinking configuration for the fallback attempt that uses this fallbacks entry's model. If you leave it out, the attempt uses the request's thinking when model supports that thinking type.

      If you leave it out and the request's thinking type is between_tools but model doesn't support between_tools, the attempt uses disabled if model supports it. Otherwise, if model doesn't support the request's thinking type, if the request doesn't set thinking, or if you set this field to null, the attempt uses the thinking type that model uses when a request leaves out thinking. The request's thinking.display still applies where model allows it.

      These rules apply with the server-side-fallback-2026-07-01 beta header.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • model

         final Model model()

        The model that will complete your prompt.

        See models for additional details and options.

      • maxTokens

         final Optional<Long> maxTokens()

        The max_tokens for the fallback attempt that uses this fallbacks entry's model, in place of the request's max_tokens. If you leave it out or set it to null, the attempt uses the request's max_tokens.

        See the refusals and fallback guide to learn more about fallback entries.

      • outputConfig

         final Optional<BetaOutputConfig> outputConfig()

        Output parameters for the fallback attempt that uses this fallbacks entry's model, combined with the request's output_config one field at a time.

        • format: If you leave it out, the attempt uses the request's format. If you set it to null, the attempt runs without a format.

        • effort: If you leave it out, the attempt uses the request's effort when model supports that level with the attempt's thinking. If the request doesn't set effort, if model doesn't support the level, or if you set effort to null, the attempt runs at the default effort of model.

        • task_budget: If you leave it out, the attempt uses the request's task_budget when model accepts a task budget of that size. If the request doesn't set task_budget, if model doesn't accept it, or if you set task_budget to null, the attempt runs without a task budget.

        Set output_config to null to run the attempt without a format or a task budget, at the default effort of model.

        These rules apply with the server-side-fallback-2026-07-01 beta header.

      • speed

         final Optional<BetaFallbackParam.Speed> speed()

        The inference speed mode for the fallback attempt that uses this fallbacks entry's model. If you leave it out, the attempt runs at fast speed only when the request sets speed to fast and your organization can use fast mode on model.

        Otherwise, or when you set this field to null, the attempt runs at standard speed.

        These rules apply with the server-side-fallback-2026-07-01 beta header.

      • thinking

         final Optional<BetaFallbackParam.Thinking> thinking()

        The thinking configuration for the fallback attempt that uses this fallbacks entry's model. If you leave it out, the attempt uses the request's thinking when model supports that thinking type.

        If you leave it out and the request's thinking type is between_tools but model doesn't support between_tools, the attempt uses disabled if model supports it. Otherwise, if model doesn't support the request's thinking type, if the request doesn't set thinking, or if you set this field to null, the attempt uses the thinking type that model uses when a request leaves out thinking. The request's thinking.display still applies where model allows it.

        These rules apply with the server-side-fallback-2026-07-01 beta header.

      • _model

         final JsonField<Model> _model()

        Returns the raw JSON value of model.

        Unlike model, this method doesn't throw if the JSON field has an unexpected type.

      • _maxTokens

         final JsonField<Long> _maxTokens()

        Returns the raw JSON value of maxTokens.

        Unlike maxTokens, this method doesn't throw if the JSON field has an unexpected type.

      • _outputConfig

         final JsonField<BetaOutputConfig> _outputConfig()

        Returns the raw JSON value of outputConfig.

        Unlike outputConfig, this method doesn't throw if the JSON field has an unexpected type.

      • validate

         final BetaFallbackParam validate()

        Validates that the types of all values in this object match their expected types recursively.

        This method is not forwards compatible with new types from the API for existing fields.

      • of

         final static BetaFallbackParam of(String value)

        Alias for calling of with Model.of(value).

        You should usually call of with a well-typed Model constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.