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:
claude-opus-4-8
Example:

"claude-opus-4-8"

messages
object[]
required

A list of messages comprising the conversation so far.

Minimum array length: 1
Example:
max_tokens
integer
default:8192

The maximum number of tokens to generate.

Required range: 1 <= x <= 8192
temperature
number
default:1
deprecated

Custom temperature values are not supported. Only the compatibility value 1 is accepted; omit this field for normal requests.

Required range: 1 <= x <= 1
Example:

1

top_p
number
default:1
deprecated

Custom nucleus sampling is not supported. Values from 0.99 to 1 are accepted only for backward compatibility; omit this field for normal requests.

Required range: 0.99 <= x <= 1
top_k
integer
deprecated

Not supported on this model. Any supplied value returns a 400 error.

Required range: x >= 0
frequency_penalty
number
default:0

Penalizes repeated tokens based on their frequency in the text so far.

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

Penalizes tokens that have already appeared in the text.

Required range: -2 <= x <= 2
stream
boolean
default:false

If true, stream partial message deltas using SSE.

stop

Sequences where the model will stop generating further tokens.

Response

Completion generated successfully

id
string
required
Example:

"chatcmpl-abc123"

object
string
required
Example:

"chat.completion"

created
integer
required

Unix timestamp

model
string
required
Example:

"claude-opus-4-8"

choices
object[]
required
usage
object