元曜星辰 Docs
OpenAI

文本补全(旧版)

POST
/openai/completions

授权

授权Bearer <token>

位置: header

请求主体

application/json

TypeScript 定义

在 TypeScript 中使用 request body 类型。

响应主体

application/json

curl -X POST "https://example.com/openai/completions" \  -H "Content-Type: application/json" \  -d '{    "model": "string",    "prompt": "string"  }'
{  "id": "string",  "object": "string",  "created": 0,  "model": "string",  "choices": [    {      "index": 0,      "text": "string",      "finish_reason": "string"    }  ],  "usage": {    "prompt_tokens": 0,    "completion_tokens": 0,    "total_tokens": 0  }}