---
title: Chat Completions
description: Send conversation messages using the OpenAI-compatible chat endpoint.
lastUpdated: 2026-09-08
---

Send a JSON request to `POST /v1/chat/completions` with `Authorization: Bearer YOUR_API_KEY`.

## Parameters

| Parameter | Required | Meaning |
| --- | --- | --- |
| `model` | Yes | Exact model ID from the current model list. |
| `messages` | Yes | Conversation history and current input, with `role` and `content` for each message. Common roles are `system`, `user`, and `assistant`. |
| `temperature` | No | Sampling temperature; range and default depend on the selected model. |
| `stream` | No | Set to `true` to receive incremental output where supported. |
| `max_tokens` | No | Maximum output token count. |
| `tools` | No | Tool or function definitions, where supported. |
| `reasoning_effort` | No | Model-specific reasoning level, commonly `low`, `medium`, or `high` where supported. |

Select the model through [Models API](/en/api-reference/models). Do not assume all models accept the same optional parameters. See [Usage and costs](/en/getting-started/billing-logic) for how conversation history affects input consumption.
