Create a Text Completion
$ ant completions createPOST/v1/complete
[Legacy] Create a Text Completion.
The Text Completions API is a legacy API. We recommend using the Messages API going forward.
Future models and features will not be compatible with Text Completions. See our migration guide for guidance in migrating from Text Completions to Messages.
Parameters
Header param: Optional header to specify the beta version(s) you want to use.
Returns
Create a Text Completion
ant completions create \
--api-key my-anthropic-api-key \
--max-tokens-to-sample 256 \
--model claude-sonnet-5 \
--prompt '
Human: Hello, world!
Assistant:'{
"id": "compl_018CKm6gsux7P8yMcwZbeCPw",
"completion": " Hello! My name is Claude.",
"model": "claude-2.1",
"stop_reason": "stop_sequence",
"type": "completion"
}Returns Examples
{
"id": "compl_018CKm6gsux7P8yMcwZbeCPw",
"completion": " Hello! My name is Claude.",
"model": "claude-2.1",
"stop_reason": "stop_sequence",
"type": "completion"
}