Skip to main content
POST

Authorizations

Authorization
string
header
required

Your PrimaLabs API key, sent as Authorization: Bearer <key>.

Body

application/json
model
string
required

A model ID from the published catalog.

Example:

"primalabs-ai/DeepSeek-V4.1-Flash-1017"

messages
object[]
required

The conversation so far.

stream
boolean
default:false

Stream partial deltas as server-sent events.

max_tokens
integer

Maximum tokens to generate, reasoning tokens included. A model's limit is max_output_tokens in List models.

reasoning_effort
enum<string>

How much the model thinks before it answers; none turns thinking off. Thinking is on by default. Each model accepts only some of these values and returns 400 for the rest: see reasoning_effort_accepted in List models and Effort levels.

Available options:
none,
minimal,
low,
medium,
high,
xhigh,
max
tools
object[]

Functions the model may call. Supported on every model in the catalog.

tool_choice

auto (the default when tools is set), none, required, or {"type": "function", "function": {"name": "..."}} to force one function.

Available options:
auto,
none,
required
response_format
object

{"type": "json_schema", "json_schema": {"name": "...", "schema": {...}}} returns JSON that matches the schema, on models where supports_response_schema is true in List models.

cache_salt
string

Keeps this request's cached prompt prefixes apart from requests with a different salt, within your account. See Prompt caching.

Example:

"customer-1234"

temperature
number

Some models run fixed values or accept only a few: see Sampling parameters.

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

Some models run a fixed value: see Sampling parameters.

stop

Sequences where the model stops. With thinking on, a stop sequence can end some models' answers empty: see Known limitations.

frequency_penalty
number
default:0
presence_penalty
number
default:0

Response

A chat completion, or an SSE stream when stream is true.

id
string
object
string
Example:

"chat.completion"

created
integer
model
string
choices
object[]
usage
object