Completions
Create a Text Completion
ModelsExpand Collapse
class Completion: …
id: str
Unique object identifier.
The format and length of IDs may change over time.
completion: str
The resulting completion up to and excluding the stop sequences.
The model that will complete your prompt.
See models for additional details and options.
UnionMember0 = Literal["claude-opus-4-5-20251101", "claude-opus-4-5", "claude-3-7-sonnet-latest", 17 more]
The model that will complete your prompt.
See models for additional details and options.
claude-opus-4-5-20251101- Premium model combining maximum intelligence with practical performanceclaude-opus-4-5- Premium model combining maximum intelligence with practical performanceclaude-3-7-sonnet-latest- Deprecated: Will reach end-of-life on February 19th, 2026. Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.claude-3-7-sonnet-20250219- Deprecated: Will reach end-of-life on February 19th, 2026. Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.claude-3-5-haiku-latest- Fastest and most compact model for near-instant responsivenessclaude-3-5-haiku-20241022- Our fastest modelclaude-haiku-4-5- Hybrid model, capable of near-instant responses and extended thinkingclaude-haiku-4-5-20251001- Hybrid model, capable of near-instant responses and extended thinkingclaude-sonnet-4-20250514- High-performance model with extended thinkingclaude-sonnet-4-0- High-performance model with extended thinkingclaude-4-sonnet-20250514- High-performance model with extended thinkingclaude-sonnet-4-5- Our best model for real-world agents and codingclaude-sonnet-4-5-20250929- Our best model for real-world agents and codingclaude-opus-4-0- Our most capable modelclaude-opus-4-20250514- Our most capable modelclaude-4-opus-20250514- Our most capable modelclaude-opus-4-1-20250805- Our most capable modelclaude-3-opus-latest- Deprecated: Will reach end-of-life on January 5th, 2026. Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.claude-3-opus-20240229- Deprecated: Will reach end-of-life on January 5th, 2026. Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.claude-3-haiku-20240307- Our previous most fast and cost-effective
"claude-opus-4-5-20251101"
Premium model combining maximum intelligence with practical performance
"claude-opus-4-5"
Premium model combining maximum intelligence with practical performance
"claude-3-7-sonnet-latest"
High-performance model with early extended thinking
"claude-3-7-sonnet-20250219"
High-performance model with early extended thinking
"claude-3-5-haiku-latest"
Fastest and most compact model for near-instant responsiveness
"claude-3-5-haiku-20241022"
Our fastest model
"claude-haiku-4-5"
Hybrid model, capable of near-instant responses and extended thinking
"claude-haiku-4-5-20251001"
Hybrid model, capable of near-instant responses and extended thinking
"claude-sonnet-4-20250514"
High-performance model with extended thinking
"claude-sonnet-4-0"
High-performance model with extended thinking
"claude-4-sonnet-20250514"
High-performance model with extended thinking
"claude-sonnet-4-5"
Our best model for real-world agents and coding
"claude-sonnet-4-5-20250929"
Our best model for real-world agents and coding
"claude-opus-4-0"
Our most capable model
"claude-opus-4-20250514"
Our most capable model
"claude-4-opus-20250514"
Our most capable model
"claude-opus-4-1-20250805"
Our most capable model
"claude-3-opus-latest"
Excels at writing and complex tasks
"claude-3-opus-20240229"
Excels at writing and complex tasks
"claude-3-haiku-20240307"
Our previous most fast and cost-effective
stop_reason: Optional[str]
The reason that we stopped.
This may be one the following values:
"stop_sequence": we reached a stop sequence — either provided by you via thestop_sequencesparameter, or a stop sequence built into the model"max_tokens": we exceededmax_tokens_to_sampleor the model's maximum
type: Literal["completion"]
Object type.
For Text Completions, this is always "completion".