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

# Create chat completion

`POST /chat/completions`

Creates a model response for the given conversation. This is the OpenAI Chat Completions API.
Some models return chain-of-thought reasoning in the `reasoning` field of the response message. The `-instant` model variants do not produce reasoning on this endpoint.

## Request body

- ChatCompletionRequest
  - `model` 'corti-s1' | 'corti-s1-instant' | 'corti-s1-mini' | 'corti-s1-mini-instant', required
  - `messages` Message[], required — Conversation messages. Supported roles: `user`, `assistant`, `tool`, and `system`.
    - union
      - object
        - `role` 'user', required
        - `content` string, required
      - object
        - `role` 'system', required
        - `content` string, required
      - object
        - `role` 'assistant', required
        - `content` string, nullable
        - `reasoning` string, nullable — Chain-of-thought reasoning, if produced by the model. The `-instant` variants do not produce this field.
        - `tool_calls` ToolCall[]
          - `id` string
          - `type` 'function'
          - `function` object
            - `name` string
            - `arguments` string — JSON-encoded arguments.
      - object
        - `role` 'tool', required
        - `content` string, required
        - `tool_call_id` string, required
  - `stream` boolean — If true, returns SSE with `data: {chunk}` lines. Terminates with `data: [DONE]`.
  - `temperature` number, float
  - `top_p` number, float
  - `max_tokens` integer — Maximum tokens to generate.
  - `tools` FunctionTool[] — Function tools the model may call. Max 128.
    - `type` 'function', required
    - `function` object, required
      - `name` string, required
      - `description` string, required
      - `parameters` object, required
  - `tool_choice` 'auto'
  - `response_format` object
    - `type` 'json_object', required
  - `logprobs` boolean
  - `top_logprobs` integer

## Response `200`

Successful response. For non-streaming requests, returns a complete chat completion. For streaming requests, returns Server-Sent Events (SSE) with incremental chunks.

- ChatCompletionResponse
  - `id` string
  - `object` 'chat.completion'
  - `created` integer
  - `model` string — The model name used for this response.
  - `choices` object[]
    - `index` integer
    - `message` ChatResponseMessage
      - `role` 'assistant'
      - `content` string, nullable
      - `reasoning` string, nullable — Chain-of-thought reasoning, if produced by the model. The `-instant` variants return `null` for this field.
      - `refusal` string, nullable
      - `annotations` unknown[], nullable
        - unknown
      - `audio` object, nullable
      - `function_call` object, nullable
      - `tool_calls` ToolCall[]
        - `id` string
        - `type` 'function'
        - `function` object
          - `name` string
          - `arguments` string — JSON-encoded arguments.
    - `logprobs` object, nullable
    - `finish_reason` 'stop' | 'length' | 'tool_calls'
    - `stop_reason` integer, nullable — Stop reason code.
    - `token_ids` integer[], nullable
    - `routed_experts` unknown[], nullable
      - unknown
  - `system_fingerprint` string, nullable
  - `usage` object
    - `prompt_tokens` integer
    - `completion_tokens` integer
    - `total_tokens` integer
    - `prompt_tokens_details` object, nullable
  - `service_tier` string, nullable
  - `prompt_logprobs` object, nullable
  - `prompt_token_ids` integer[], nullable
  - `prompt_text` string, nullable
  - `kv_transfer_params` object, nullable

## Other responses

- `401` — Authentication failed
- `429` — Rate limit exceeded

---

[API](https://skmtc.net/corti/apis/admin-api.md) · [All operations](https://skmtc.net/corti/apis/admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/corti/admin-api/revisions/5d1895a1b3fc/schema)
