Skip to main content
POST
Chat Completion

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

Model ID

Available options:
grok-4-1-fast-non-reasoning
Example:

"grok-4-1-fast-non-reasoning"

messages
object[]
required

A list of messages comprising the conversation so far.

Minimum array length: 1
Example:
max_tokens
integer

The maximum number of tokens to generate.

Required range: x >= 1
temperature
number
default:1

Sampling temperature.

Required range: 0 <= x <= 2
Example:

1

top_p
number

Nucleus sampling threshold.

Required range: 0 <= x <= 1
stream
boolean
default:false

If true, stream partial message deltas using SSE.

Response

Completion generated successfully

id
string
object
string
Example:

"chat.completion"

created
integer
model
string
Example:

"grok-4-1-fast-non-reasoning"

choices
object[]
usage
object