Skip to main content
POST

Authorizations

Authorization
string
header
required

Modular Cloud API token. Obtain from the API Tokens page.

Body

application/json
model
string
required

Model identifier. See the supported models page.

Example:

"google/gemma-4-26B-A4B-it"

messages
object[]
required

The conversation history.

max_tokens
integer

Maximum number of tokens to generate.

temperature
number

Sampling temperature (0–2). Higher values produce more varied output.

Required range: 0 <= x <= 2
stream
boolean

If true, stream partial tokens as server-sent events. Support for tools while streaming is model-dependent; set this to false if you see incomplete or malformed tool-call output.

tools
object[]

List of functions the model may call. Only supported on models that are pretrained for tool use; see the supported models page.

tool_choice

Controls whether and how the model calls a tool. none disables tool calls; auto (default) lets the model decide; required forces at least one tool call; or pass an object naming a specific function to force that call.

Available options:
none,
auto,
required

Response

200 - application/json

Chat completion response.

id
string
required
object
string
required
Example:

"chat.completion"

model
string
required
choices
object[]
required
usage
object