Skip to main content
POST
/
models
/
v2
/
openai
/
v1
/
completions
Completions
curl --request POST \
  --url https://api.bytez.com/models/v2/openai/v1/completions \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "<string>",
  "prompt": "<string>",
  "max_tokens": 256,
  "temperature": 0.7,
  "top_p": 1,
  "stream": false
}'
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "choices": [
    {
      "index": 123,
      "text": "<string>",
      "finish_reason": "<string>"
    }
  ]
}

Body

application/json
model
string
required

The ID of the completion model to run (e.g., "text-davinci-003")

prompt
string
required

The input text prompt

max_tokens
integer
default:256

Maximum number of tokens to generate

temperature
number
default:0.7

Sampling temperature

top_p
number
default:1

Nucleus sampling probability

stream
boolean
default:false

Whether to stream responses

Response

Successful text completion

id
string
object
string
created
integer
choices
object[]
I