Create chat completion
Generate a response from a conversation. Accepts text, image, and video input for multimodal models, and supports function calling via tools/tool_choice. Request and response shapes match the OpenAI Chat Completions API, so existing OpenAI SDK clients work unchanged.
Authorizations
Modular Cloud API token. Obtain from the API Tokens page.
Body
Model identifier. See the supported models page.
"google/gemma-4-26B-A4B-it"
The conversation history.
Maximum number of tokens to generate.
Sampling temperature (0–2). Higher values produce more varied output.
0 <= x <= 2If 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.
List of functions the model may call. Only supported on models that are pretrained for tool use; see the supported models page.
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.
none, auto, required