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

# Create completion

`POST /completions`

Creates a text completion for the given prompt. Supports streaming via SSE.

## Request body

- CompletionRequest
  - `model` 'corti-s1' | 'corti-s1-instant' | 'corti-s1-mini' | 'corti-s1-mini-instant', required
  - `prompt` union, required
    - string — Single prompt string.
    - string[] — Batch of prompt strings.
  - `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.
  - `logprobs` boolean
  - `top_logprobs` integer

## Response `200`

Successful response. For non-streaming requests, returns a complete text completion. For streaming requests, returns Server-Sent Events (SSE) with incremental text chunks. Terminates with `data: [DONE]`.

- CompletionResponse
  - `id` string — Unique completion ID (e.g. `cmpl-8acdd476-...`).
  - `object` 'text_completion'
  - `created` integer — Unix timestamp (seconds).
  - `model` string — The model name used for this response.
  - `choices` object[]
    - `index` integer
    - `text` string — The completion text.
    - `logprobs` object, nullable
    - `prompt_logprobs` object, nullable
    - `prompt_token_ids` integer[], nullable
    - `token_ids` integer[], nullable
    - `routed_experts` unknown[], nullable
      - unknown
    - `stop_reason` integer, nullable — Stop reason code.
    - `finish_reason` 'stop' | 'length'
  - `system_fingerprint` string, nullable
  - `service_tier` string, nullable
  - `kv_transfer_params` object, nullable
  - `usage` object
    - `prompt_tokens` integer
    - `completion_tokens` integer
    - `total_tokens` integer
    - `prompt_tokens_details` 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)
