Class BetaFallbackCreditTokenParam
-
- All Implemented Interfaces:
public final class BetaFallbackCreditTokenParamObject form of
`fallback_credit_token`: the token plus a redemption mode.Requires
`anthropic-beta: fallback-credit-2026-07-01`; without that header the field accepts the bare string only. The bare string and the mode-less object are equivalent (both select`strict`), so wrapping an existing token changes nothing by itself.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBetaFallbackCreditTokenParam.BuilderA builder for BetaFallbackCreditTokenParam.
public final classBetaFallbackCreditTokenParam.ModeHow a failing token affects the retry.
strict(the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served.best_effort: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response'susage.fallback_credit. Two failures stay hard in both modes: a malformed token, and combiningfallback_credit_tokenwithfallbacks.
-
Method Summary
Modifier and Type Method Description final Stringtoken()The opaque fallback_credit_tokenfrom a prior refusal'sstop_details— the same string the bare-string form carries.final Optional<BetaFallbackCreditTokenParam.Mode>mode()How a failing token affects the retry. final JsonField<String>_token()Returns the raw JSON value of token. final JsonField<BetaFallbackCreditTokenParam.Mode>_mode()Returns the raw JSON value of mode. final Map<String, JsonValue>_additionalProperties()final BetaFallbackCreditTokenParam.BuildertoBuilder()final BetaFallbackCreditTokenParamvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaFallbackCreditTokenParam.Builderbuilder()Returns a mutable builder for constructing an instance of BetaFallbackCreditTokenParam. final static BetaFallbackCreditTokenParamof(String token)Returns an immutable instance of BetaFallbackCreditTokenParam with the required token set to the given value. -
-
Method Detail
-
token
final String token()
The opaque
fallback_credit_tokenfrom a prior refusal'sstop_details— the same string the bare-string form carries.
-
mode
final Optional<BetaFallbackCreditTokenParam.Mode> mode()
How a failing token affects the retry.
strict(the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served.best_effort: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response'susage.fallback_credit. Two failures stay hard in both modes: a malformed token, and combiningfallback_credit_tokenwithfallbacks.
-
_token
final JsonField<String> _token()
Returns the raw JSON value of token.
Unlike token, this method doesn't throw if the JSON field has an unexpected type.
-
_mode
final JsonField<BetaFallbackCreditTokenParam.Mode> _mode()
Returns the raw JSON value of mode.
Unlike mode, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final BetaFallbackCreditTokenParam.Builder toBuilder()
-
validate
final BetaFallbackCreditTokenParam 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.
-
builder
final static BetaFallbackCreditTokenParam.Builder builder()
Returns a mutable builder for constructing an instance of BetaFallbackCreditTokenParam.
The following fields are required:
.token()
-
of
final static BetaFallbackCreditTokenParam of(String token)
Returns an immutable instance of BetaFallbackCreditTokenParam with the required token set to the given value.
-
-
-
-