Create Completion

Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position. Create a completion for the provided prompt and parameters https://platform.openai.com/docs/api-reference/completions

Endpoint

POST http://v98store.com/v1/completions

cURL Command

curl -X POST 'http://v98store.com/v1/completions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer YOUR_TOKEN' \ -d '{ "model": "gpt-3.5-turbo-instruct", "prompt": "Hello,", "max_tokens": 30, "temperature": 0 }'

Parameters

NameInDescriptionRequired
AuthorizationheaderNo

Request Body

Example

{
  "model": "gpt-3.5-turbo-instruct",
  "prompt": "Hello,",
  "max_tokens": 30,
  "temperature": 0
}

Responses

200 -

Example

{
  "id": "cmpl-ByvHP6AWeB1L5vWZSPNHsB12sU9db",
  "object": "text_completion",
  "created": 1753859563,
  "model": "gpt-3.5-turbo-instruct",
  "choices": [
    {
      "index": 0,
      "logprobs": null,
      "finish_reason": "length",
      "text": "我Yes小冰,很高兴认识你. 我Yes一 人工智能助手, can以回"
    }
  ],
  "usage": {
    "prompt_tokens": 3,
    "completion_tokens": 30,
    "total_tokens": 33
  }
}