Skip to main content

Chat Completions

The chat completions endpoint is the recommended way to generate text. It supports multi-turn conversations with system, user, and assistant messages.
Edge endpoints require a JWT. See Authentication for how to obtain one.

Create Chat Completion

Generate a chat completion for the given messages.

Request Body

Function / tool calling is not supported. The tools, functions, and function_call parameters are silently ignored by the chat completions endpoint. To use tools, parse the model’s text output and dispatch tool calls in your application code.

Message Format

Example Request

Response

Streaming

For real-time responses, enable streaming:

Stream Response Format

Each chunk is a Server-Sent Event:

Finish Reasons