跳转到主要内容
POST /v1/completions 发送明确模型和文本 prompt,可用 stream 选择 SSE。本规范限定单条文本、单个输出。 响应读取 choices[].text;流式也使用 text。finish_reason=stop 才是本例接受的完成结果;length / content_filter 不是完整答案。模型能力、可选参数保留和额外字段依渠道而定。见完整指南与示例。 Read in English

授权

Authorization
string
header
必填

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

请求体

application/json
model
string
必填
prompt
string
必填
stream
boolean

响应

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

choices
object[]
必填