Skip to main content
POST
cURL
OpenAI-compatible endpoint for open-weights models hosted on Relace infrastructure. You can also use this by pointing any OpenAI SDK at https://models.relace.ai/v1 with your Relace API key.

Models

The catalog endpoint returns the current catalog with pricing and supported features. See the Open Models guide for SDK examples and streaming.

Authorizations

Authorization
string
header
required

Relace API key Authorization header using the Bearer scheme.

Body

application/json

OpenAI-compatible chat completions request

OpenAI-compatible request. Supported sampling parameters vary slightly by model; the List Models endpoint reports supported_sampling_parameters and supported_features per model.

model
string
required

ID of the hosted model to use, e.g. deepseek-ai/DeepSeek-V4-Flash-0731 or moonshotai/kimi-k3. See the List Models endpoint for the full catalog.

messages
object[]
required

The conversation so far, as OpenAI-format message objects with role and content.

stream
boolean

If true, tokens are sent as server-sent events as they are generated. Token usage is always reported in the final chunk of the stream.

max_tokens
integer

Maximum number of tokens to generate. Reasoning tokens count toward this limit, so set a generous budget.

temperature
number

Sampling temperature. Higher values make output more random.

top_p
number

Nucleus sampling: only tokens within the top top_p probability mass are considered.

top_k
integer

Only the top_k most likely tokens are considered at each step.

stop
string[]

Up to 4 sequences at which generation stops.

frequency_penalty
number

Penalizes tokens by how often they have appeared so far. Range -2 to 2.

presence_penalty
number

Penalizes tokens that have appeared at all so far. Range -2 to 2.

repetition_penalty
number

Multiplicative penalty on repeated tokens. Values above 1 discourage repetition.

tools
object[]

OpenAI-format function tool definitions the model may call.

tool_choice
any

Controls tool use: none, auto, required, or a specific tool.

response_format
object

Set to {"type": "json_object"} for JSON mode. Kimi K3 only.

Response

Chat completion generated

id
string

Unique identifier for the completion

object
string

Always chat.completion

created
integer

Unix timestamp of when the completion was created

model
string

The model that served the request

choices
object[]

The generated completions

usage
object

Token usage information for the request