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

# Create chat completions

`POST /v1/private/chat/completions`

Create chat completions

## Request body

- ChatCompletionRequest
  - `model` string
  - `messages` Message[]
    - `role` string, required
    - `content` JsonNode, required
  - `temperature` number, double
  - `top_p` number, double
  - `n` integer
  - `stream` boolean
  - `stream_options` StreamOptions
    - `include_usage` boolean
  - `stop` string[]
  - `max_tokens` integer
  - `max_completion_tokens` integer
  - `presence_penalty` number, double
  - `frequency_penalty` number, double
  - `logit_bias` object
  - `user` string
  - `response_format` ResponseFormat
    - `type` 'text' | 'json_object' | 'json_schema'
    - `json_schema` JsonSchema
      - `name` string
      - `strict` boolean
      - `schema` object
  - `seed` integer
  - `tools` Tool[]
    - `type` 'function'
    - `function` Function
      - `name` string
      - `description` string
      - `strict` boolean
      - `parameters` object
  - `tool_choice` object
  - `parallel_tool_calls` boolean
  - `store` boolean
  - `metadata` object
  - `reasoning_effort` string
  - `service_tier` string
  - `logprobs` boolean
  - `top_logprobs` integer
  - `functions` Function[]
    - `name` string
    - `description` string
    - `strict` boolean
    - `parameters` object
  - `function_call` FunctionCall
    - `name` string
    - `arguments` string

## Response `200`

Chat completions response

- ChatCompletionResponse
  - `id` string
  - `created` integer
  - `model` string
  - `choices` ChatCompletionChoice[]
    - `index` integer
    - `message` AssistantMessage
      - `role` 'system' | 'user' | 'assistant' | 'tool' | 'function'
      - `content` string
      - `reasoning_content` string
      - `name` string
      - `tool_calls` ToolCall[]
        - `id` string
        - `index` integer
        - `type` 'function'
        - `function` FunctionCall
          - `name` string
          - `arguments` string
      - `refusal` string
      - `function_call` FunctionCall
        - `name` string
        - `arguments` string
    - `delta` Delta
      - `role` string
      - `content` string
      - `reasoning_content` string
      - `tool_calls` ToolCall[]
        - `id` string
        - `index` integer
        - `type` 'function'
        - `function` FunctionCall
          - `name` string
          - `arguments` string
      - `function_call` FunctionCall
        - `name` string
        - `arguments` string
    - `finish_reason` string
    - `logprobs` LogProbs
      - `content` LogProb[]
        - `token` string
        - `logprob` number, double
        - `bytes` integer[]
  - `usage` Usage
    - `total_tokens` integer
    - `prompt_tokens` integer
    - `prompt_tokens_details` PromptTokensDetails
      - `cached_tokens` integer
    - `completion_tokens` integer
    - `completion_tokens_details` CompletionTokensDetails
      - `reasoning_tokens` integer
  - `system_fingerprint` string
  - `service_tier` string

---

[API](https://skmtc.net/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.net/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/versions/4ed2fbc97cc3/schema)
