Skip to main content
POST
Create 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.6
Example:

"grok-4.6"

messages
object[]
required

Conversation messages. User messages accept plain text or combined text and image URL parts.

Minimum array length: 1
reasoning_effort
enum<string>
default:high

Reasoning effort.

Available options:
low,
medium,
high,
xhigh
max_tokens
integer

Maximum number of completion tokens.

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

Whether to return SSE deltas.

Response

Chat completion generated successfully

id
string
object
string
Example:

"chat.completion"

created
integer
model
string
Example:

"grok-4.6"

choices
object[]
usage
object