Skip to main content
POST
Create a chat completion (OpenAI-compatible)

Authorizations

Authorization
string
header
required

Gateway API key (imp-rt-...) from POST /v1/accounts or /v1/keys.

Body

application/json
model
string
required
Example:

"openai/gpt-4o-mini"

messages
object[]
required
stream
boolean
default:false
stream_options
object
temperature
number
top_p
number
max_tokens
integer
max_completion_tokens
integer
tools
object[]

Function tools the model may call (relay mode — the gateway does not execute them).

tool_choice

auto, none, required, or { type: function, function: { name } }.

Available options:
auto,
none,
required
parallel_tool_calls
boolean
reasoning_effort
enum<string>

Forwarded across native OpenAI, Azure OpenAI, and OpenAI-compatible routes.

Available options:
none,
minimal,
low,
medium,
high,
xhigh

Response

A chat.completion object. When stream: true, the body is instead an SSE stream of chat.completion.chunk objects terminated by data: [DONE].

Non-streaming chat completion (OpenAI chat.completion).

id
string
Example:

"chatcmpl-..."

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

Unix seconds

model
string
Example:

"openai/gpt-4o-mini"

choices
object[]
usage
object

OpenAI-style token usage.