Reference Requests and replies
Model, thinking and effort
Which model answers, how much it reasons, and which beta features a request turns on.
Reference#
Model#
val ClaudeFable5_2: Model = of("claude-fable-5-2")
val ClaudeOpus5_5: Model = of("claude-opus-5-5")
val ClaudeOpus5: Model = of("claude-opus-5")
val ClaudeOpus4_8: Model = of("claude-opus-4-8")
val ClaudeSonnet5_5: Model = of("claude-sonnet-5-5")
val ClaudeSonnet5: Model = of("claude-sonnet-5")
val ClaudeHaiku5_5: Model = of("claude-haiku-5-5")
val ClaudeHaiku4_5: Model = of("claude-haiku-4-5")
def of(value: String): Model
Model.of names a model the SDK has no constant for yet.
ThinkingConfig#
val adaptive: ThinkingConfig = new ThinkingConfig("adaptive", None, None, JsonObject.empty)
val disabled: ThinkingConfig = new ThinkingConfig("disabled", None, None, JsonObject.empty)
val betweenTools: ThinkingConfig = new ThinkingConfig("between_tools", None, None, JsonObject.empty)
def enabled(budgetTokens: Int): ThinkingConfig =
new ThinkingConfig("enabled", Some(budgetTokens), None, JsonObject.empty)
def withDisplay(d: ThinkingDisplay): ThinkingConfig
val Summarized: ThinkingDisplay = of("summarized")
val Omitted: ThinkingDisplay = of("omitted")
val Updates: ThinkingDisplay = of("updates")
Caveats
- Use
adaptiveon current models: the model decides when and how much to think, andEffortsteers the depth. enabled(budget)only works on older models; it is a 400 on Opus 4.7 and later. Several current models rejectdisabledtoo.Summarizedreturns readable reasoning; current models default toOmitted.
Effort#
val Low: Effort = of("low")
val Medium: Effort = of("medium")
val High: Effort = of("high")
val XHigh: Effort = of("xhigh")
val Max: Effort = of("max")
def withEffort(e: Effort): MessageRequest
Fallbacks#
sealed trait Fallbacks extends Product with Serializable
case object Default extends Fallbacks
final case class Models(models: List[Model]) extends Fallbacks
Caveats
- Server-side fallbacks need
Beta.ServerSideFallback, on the client or on the call.
Beta#
val ServerSideFallback: Beta = of("server-side-fallback-2026-07-01")
val Compaction: Beta = of("compact-2026-01-12")
val ContextManagement: Beta = of("context-management-2025-06-27")
val TaskBudgets: Beta = of("task-budgets-2026-03-13")
val McpClient: Beta = of("mcp-client-2025-11-20")
val MessageThreads: Beta = of("message-threads-2026-08-12")
val CacheDiagnosis: Beta = of("cache-diagnosis-2026-04-07")
Turn one on for every request with AnthropicConfig.withBetas, or for one call with RequestOptions.withBetas.
Every signature and example on this page is copied, character for character, from the public source of anthropic4s and its Scaladoc. The complete API, every type included, is in the Scaladoc of each module.