Skip to main content
POST

Authorizations

Authorization
string
header
required

Your Infyrence API key, sent as Authorization: Bearer sk-....

Body

application/json
model
string
required

The model to use. Any id returned by GET /v1/models.

Examples:

"claude-sonnet-5"

"gpt-5.5"

"gemini-3.1-pro"

messages
object[]
required

The conversation so far, as a list of messages.

Minimum array length: 1
temperature
number

Sampling temperature. Higher is more random.

Required range: 0 <= x <= 2
top_p
number

Nucleus sampling probability mass.

Required range: 0 <= x <= 1
max_tokens
integer

Maximum number of tokens to generate in the completion.

Required range: x >= 1
stream
boolean
default:false

If true, stream the response as Server-Sent Events.

stop

Up to a few sequences where generation stops.

frequency_penalty
number

Penalize new tokens by their existing frequency in the text so far.

Required range: -2 <= x <= 2
presence_penalty
number

Penalize new tokens by whether they already appear in the text so far.

Required range: -2 <= x <= 2
n
integer

Number of completions to generate.

Required range: x >= 1
seed
integer

Best-effort deterministic sampling seed.

Response

The chat completion. When stream is false (default), the body is a single ChatCompletionResponse JSON object. When stream is true, the body is a text/event-stream of ChatCompletionChunk objects , each sent as a data: {...} line, terminated by a final data: [DONE].

id
string
required
object
string
required
Allowed value: "chat.completion"
created
integer
required

Unix timestamp (seconds) of when the completion was created.

model
string
required
choices
object[]
required
usage
object
required