POST
/
models
/
v2
/
openai
/
{model}
curl --request POST \
  --url https://api.bytez.com/models/v2/openai/{model} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Provider-Key: <api-key>' \
  --data '{
  "messages": [
    {
      "role": "<string>",
      "content": "<string>"
    }
  ],
  "stream": true,
  "params": {
    "max_tokens": 123
  }
}'
{
  "output": "<string>"
}

Authorizations

Authorization
string
header
required

Provide your API key as Key your-key-here in the Authorization header.

Provider-Key
string
header
required

Provide your provider API key as Provider-Key your-provider-key-here in the header.

Path Parameters

model
string
required

The specific OpenAI model to interact with (e.g., gpt-4o-mini).

Body

application/json
Send messages to the specified OpenAI model.
messages
object[]
required

Messages to process.

params
object
required
stream
boolean

Enable or disable streaming responses.

Response

200 - application/json
Successful response from the specified OpenAI model.
output
string

Model output text.