{
"id": "cmpl_example",
"object": "text_completion",
"created": 1700000000,
"model": "YOUR_MODEL_ID",
"choices": [
{
"index": 0,
"text": " explain completion states.",
"finish_reason": "stop"
}
]
}API reference
Create a text completion
Prompt requests, text output, and SSE completion fields.
{
"id": "cmpl_example",
"object": "text_completion",
"created": 1700000000,
"model": "YOUR_MODEL_ID",
"choices": [
{
"index": 0,
"text": " explain completion states.",
"finish_reason": "stop"
}
]
}POST /v1/completions
Send an explicit model and text prompt; stream selects SSE. This contract limits the example to one text prompt and one output.
Read choices[].text for both JSON and streaming increments. The example accepts finish_reason=stop; length limits or filtering are not complete answers. Model capabilities and optional field preservation depend on the channel. See the guide and example.
阅读中文版Authorizations
模型调用 API Key,不是控制台登录凭据 / Model API key, not console login credentials
Response
读取业务字段,不只检查 HTTP 状态 / Validate business fields, not only HTTP status.
Show child attributes
Show child attributes