Skip to main content
POST
Create a chat completion

Authorizations

Authorization
string
header
required

A Fortytwo API key — see Get access.

Body

application/json

Any field not listed here returns 400 invalid_request — see OpenAI compatibility.

model
string
required

A model ID from Models.

Example:

"qwen/qwen3.8-27b"

messages
RequestMessage · object[]
required
Minimum array length: 1
max_tokens
integer

Maximum tokens to generate, up to the model's max output. Default: the model's max output. Send max_tokens or max_completion_tokens, not both.

Required range: x >= 1
max_completion_tokens
integer

Same as max_tokens.

Required range: x >= 1
reasoning_effort
enum<string>
default:medium

How much the model reasons before it answers. none turns reasoning off.

Available options:
none,
minimal,
low,
medium,
high,
xhigh,
max
stream
boolean
default:false

true returns server-sent events — see Streaming.

stream_options
object

Only with stream: true.

tools
Tool · object[]

Functions the model may call. Function names must be unique.

Required array length: 1 - 128 elements
tool_choice

auto, none, required, or a named function.

Available options:
auto,
none,
required
parallel_tool_calls
boolean

Allow more than one tool call in one message.

response_format
Text · object
n
integer

Only 1.

store
boolean

Only false. true returns 400 zdr_storage_not_supported.

temperature
number

Accepted only if the model supports it — see Models; otherwise 400 invalid_request.

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

Accepted only if the model supports it — see Models; otherwise 400 invalid_request.

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

Accepted only if the model supports it — see Models; otherwise 400 invalid_request.

Required range: 1 <= x <= 2147483647
min_p
number

Accepted only if the model supports it — see Models; otherwise 400 invalid_request.

Required range: 0 <= x <= 1
presence_penalty
number

Accepted only if the model supports it — see Models; otherwise 400 invalid_request.

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

Accepted only if the model supports it — see Models; otherwise 400 invalid_request.

stop

Accepted only if the model supports it — see Models; otherwise 400 invalid_request.

seed
integer

Accepted only if the model supports it — see Models; otherwise 400 invalid_request.

Required range: -9007199254740991 <= x <= 9007199254740991

Response

The completion. With stream: true, a text/event-stream of chat.completion.chunk events that ends with data: [DONE].

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

Unix timestamp.

model
string
required

The model ID from the request.

choices
Choice · object[]
required
usage
Usage · object
required
Last modified on October 12, 2026