---
title: "Text completion (legacy OpenAI, deprecated)"
method: POST
path: "/v1/completions"
tags: ["LLM"]
deprecated: true
---

# Text completion (legacy OpenAI, deprecated)

`POST /v1/completions`

## Request

- Base URL: `https://api.clipia.ai`
- URL: `https://api.clipia.ai/v1/completions`
- Auth: API key in header `Authorization`

> **Deprecated.**

**Устарело.** Совместимость со старыми клиентами (`continue.dev`,
langchain `OpenAI` non-chat). Тонкая проекция над тем же ядром, что и
`/v1/chat/completions`: `prompt` становится одним user-сообщением, ответ
проецируется в форму `text_completion` (`choices[].text`). Новые
интеграции должны использовать `/v1/chat/completions`; этот маршрут
не получает новых возможностей (tools, response_format, reasoning).
`id` ответа — `cmpl-…`, принимается `GET /v1/generation?id=`.

## Request body

- object
  - `model` string, required
  - `prompt` union, required
    - string
    - string[]
  - `max_tokens` integer
  - `temperature` number
  - `stream` boolean

## Response `200`

Ответ `text_completion` (JSON) либо SSE-поток при `stream: true`.

- object
  - `id` string
  - `object` 'text_completion'
  - `model` string
  - `choices` object[]
    - `index` integer
    - `text` string
    - `finish_reason` string, nullable
  - `usage` OpenAIUsage
    - `prompt_tokens` integer
    - `completion_tokens` integer
    - `total_tokens` integer
    - `cost` number: Списанные кредиты (дробные).

## Other responses

- `401`: Ключ отсутствует, неверный или отозван.
- `429`: Лимит; см. `Retry-After`.

---

[API](https://skmtc.dev/clipia/apis/clipia-api.md) · [All operations](https://skmtc.dev/clipia/apis/clipia-api/llms.txt) · [OpenAPI document](https://skmtc.dev/clipia/apis/clipia-api/revisions/cc55924a3381?raw)
