Input messages. Each input message must be an object with a role and content. You can specify a single user-role message, or include multiple user and assistant messages for multi-turn conversations.
The maximum number of tokens to generate before stopping. Note that the model may stop before reaching this maximum. Different models have different maximum values for this parameter.
System prompt. A system prompt is a way of providing context and instructions to the model.Can be a string or an array of TextBlockParam objects, each containing text, type ("text"), optional cache_control, and optional citations.
Amount of randomness injected into the response. Ranges from 0.0 to 1.0. Use temperature closer to 0.0 for analytical/multiple choice tasks, and closer to 1.0 for creative and generative tasks. Note that even with temperature of 0.0, the results will not be fully deterministic.
Use nucleus sampling. Computes the cumulative distribution over all options for each subsequent token in decreasing probability order and cuts it off once it reaches the probability specified by top_p. Recommended for advanced use cases only. You usually only need to use temperature.
Only sample from the top K options for each subsequent token. Used to remove “long tail” low probability responses. Recommended for advanced use cases only.
Custom text sequences that will cause the model to stop generating. If the model encounters one of the custom sequences, the response stop_reason value will be "stop_sequence" and the response stop_sequence value will contain the matched stop sequence.
Configuration for enabling Claude’s extended thinking. When enabled, responses include thinking content blocks showing Claude’s thinking process before the final answer. Requires a minimum budget of 1,024 tokens.
How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values: low, medium, high, max.
Citations supporting the text block. Can be char_location, page_location, content_block_location, web_search_result_location, or search_result_location.