Skip to main content
POST /v1/chat/completions generates a chat completion. See Models for model IDs and pricing. This page documents the fields Hopper defines or constrains.

Request

  • model (string, required) — gemma-4-31b.
  • messages (array, required) — Prompt and history. The context limit, including input and output, is 262,144 tokens for Gemma 4 31B.
  • stream (boolean, optional, default false) — Returns a Server-Sent Events stream of chat.completion.chunk objects.
  • tools (array, optional) — Function definitions the model may call.
The request body is limited to 10 MB; a larger body returns 413.

Streaming

On stream: true, Hopper sets stream_options.include_usage on the upstream request and removes the resulting usage chunk unless you sent that option yourself.

Tool calling

Pass tools; when the model calls one, the response message carries tool_calls instead of content.
Send the tool result back as a tool message with the matching tool_call_id to continue the conversation. Error codes are listed in Errors.