ModelSell Docs
ChatOpenAI Compatible

原生 OpenAI 格式

OpenAI Completions 兼容的文本补全接口。

POST
/v1/completions

OpenAI Completions 兼容的文本补全接口。

Authorization

bearerAuth
AuthorizationBearer <token>

使用 Authorization Bearer API Key 进行鉴权。

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/completions" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-5.4-nano",    "prompt": "讲一个关于 API 网关的短故事。",    "max_tokens": 256  }'
{
  "id": "cmpl_123",
  "object": "text_completion",
  "model": "string",
  "choices": [
    {
      "text": "string",
      "index": 0,
      "finish_reason": "string"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "input_tokens": 0,
    "output_tokens": 0
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "request_id": "string"
  }
}