Skip to main content
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

Authorization
string
header
required

模型调用 API Key,不是控制台登录凭据 / Model API key, not console login credentials

Body

application/json
model
string
required
prompt
string
required
stream
boolean

Response

读取业务字段,不只检查 HTTP 状态 / Validate business fields, not only HTTP status.

choices
object[]
required