---
title: "Create chat completion"
method: POST
path: "/v1/chat/completions"
tags: ["Chat Completions"]
---

# Create chat completion

`POST /v1/chat/completions`

Creates a chat completion for the provided messages. OpenAI-compatible endpoint. Messages are converted to a prompt internally; responses use object "chat.completion" and choices[].message with role and content.

## Request body

- ChatCompletionRequest
  - `model` string — Model identifier
  - `messages` object[], required — Conversation messages (required, non-empty)
    - `role` string, required — Message role: system, user, or assistant
    - `content` string, required — Message content
  - `max_tokens` integer — Maximum number of tokens to generate
  - `stream` boolean — Whether to stream the response as SSE
  - `stream_options` StreamOptions
    - `include_usage` boolean — Include usage statistics in response
    - `continuous_usage_stats` boolean — Include usage stats in each streamed chunk
  - `temperature` number — Sampling temperature
  - `top_p` number — Nucleus sampling probability
  - `stop` union — Stop sequence(s)
    - string
    - string[]
  - `presence_penalty` number
  - `frequency_penalty` number
  - `seed` integer
  - `user` string
  - `enable_reasoning` boolean — When false, reasoning models (e.g. DeepSeek-R1) skip chain-of-thought and respond directly. Has no effect on non-reasoning models.

## Response `200`

Successful chat completion (JSON) or streaming (text/event-stream)

- ChatCompletionResponse
  - `id` string, required — Unique chat completion identifier
  - `object` 'chat.completion', required — Object type
  - `created` integer, required — Unix timestamp of creation
  - `model` string — Model used for completion
  - `choices` object[], required
    - `index` integer
    - `message` object
      - `role` string
      - `content` string
    - `finish_reason` string
  - `usage` CompletionUsage
    - `prompt_tokens` integer — Number of tokens in the prompt
    - `completion_tokens` integer — Number of tokens in the completion
    - `total_tokens` integer — Total tokens used
    - `ttft_ms` number, nullable — Time to first token in milliseconds
    - `tps` number, nullable — Tokens per second (excluding first token)

## Other responses

- `400` — Invalid request (e.g. missing or empty messages)
- `401` — Missing or invalid authentication token
- `503` — Model not ready

---

[API](https://skmtc.net/tenstorrent/apis/tt-media-server-api-c-drogon.md) · [All operations](https://skmtc.net/tenstorrent/apis/tt-media-server-api-c-drogon/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tenstorrent/tt-media-server-api-c-drogon/revisions/f1176db3fd15/schema)
