Buat Text Completion
POST/v1/complete
[Legacy] Buat Text Completion.
Text Completions API adalah API legacy. Kami merekomendasikan penggunaan Messages API untuk ke depannya.
Model dan fitur mendatang tidak akan kompatibel dengan Text Completions. Lihat panduan migrasi kami untuk panduan bermigrasi dari Text Completions ke Messages.
Parameters
Returns
Buat Text Completion
ant completions create \
--api-key my-anthropic-api-key \
--max-tokens-to-sample 256 \
--model claude-fable-5-1 \
--prompt '
Human: Hello, world!
Assistant:'Response 200
{
"id": "compl_018CKm6gsux7P8yMcwZbeCPw",
"completion": " Hello! My name is Claude.",
"model": "claude-2.1",
"stop_reason": "stop_sequence",
"type": "completion"
}Returns Examples
Response 200
{
"id": "compl_018CKm6gsux7P8yMcwZbeCPw",
"completion": " Hello! My name is Claude.",
"model": "claude-2.1",
"stop_reason": "stop_sequence",
"type": "completion"
}