Completions
Create a Text Completion
ModelsExpand Collapse
Completion = object { id, completion, model, 2 more }
id: stringUnique object identifier.
Unique object identifier.
The format and length of IDs may change over time.
The resulting completion up to and excluding the stop sequences.
model: ModelThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
UnionMember0 = "claude-opus-4-6" or "claude-sonnet-4-6" or "claude-haiku-4-5" or 12 moreThe model that will complete your prompt.
The model that will complete your prompt.
See models for additional details and options.
Most intelligent model for building agents and coding
Best combination of speed and intelligence
Fastest model with near-frontier intelligence
Fastest model with near-frontier intelligence
Premium model combining maximum intelligence with practical performance
Premium model combining maximum intelligence with practical performance
High-performance model for agents and coding
High-performance model for agents and coding
Exceptional model for specialized complex tasks
Exceptional model for specialized complex tasks
Powerful model for complex tasks
Powerful model for complex tasks
High-performance model with extended thinking
High-performance model with extended thinking
Fast and cost-effective model
stop_reason: stringThe reason that we stopped.
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: "completion"Object type.
Object type.
For Text Completions, this is always "completion".