struct

Anthropic::OutputConfig

Inherits JSON::Serializable < Struct < Value < Object

Output configuration for controlling effort, format, and task budget.

Used on both top-level and beta messages.create / messages.count_tokens requests. The task_budget field is beta-only and should only be populated when calling through client.beta.messages.

# Set effort level
output_config = Anthropic::OutputConfig.new(effort: "high")

# Set effort + structured output format
output_config = Anthropic::OutputConfig.new(effort: "high", format: output_format)

# Beta: set a session-wide token budget
budget = Anthropic::BetaTokenTaskBudget.new(total: 200_000)
output_config = Anthropic::OutputConfig.new(effort: "xhigh", task_budget: budget)

Constructors

new(effort : String | Nil = nil, format : OutputFormat | Nil = nil, task_budget : BetaTokenTaskBudget | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

effort

Effort level. One of "low", "medium", "high", "xhigh", "max".

Source
format
Source
task_budget

Beta-only: user-configurable total token budget across contexts.

Source