---
title: "`/v1/completions` — legacy OpenAI Completions (single-candidate, raw-prompt)."
method: POST
path: "/v1/completions"
tags: ["inference"]
---

# `/v1/completions` — legacy OpenAI Completions (single-candidate, raw-prompt).

`POST /v1/completions`

OpenAI-compatible legacy Completions. Strict allow-list parser: unknown top-level fields reject with 400 `unsupported_field`. `stream: true` is supported (SSE `text_completion`). Known-rejected fields: `echo`, `suffix`, `logprobs`, `best_of`, `n > 1`, batched array `prompt` — each rejects with 400 `unsupported_field`. The response body no longer carries the always-null `logprobs` field.

## Request body

- CompletionsRequest — OpenAI-compatible ``POST /v1/completions`` request (legacy raw-prompt surface). **Strict allow-list**: unknown fields reject with 400 ``unsupported_field``. Type-invalid values reject with 400 ``invalid_request``. **Known-rejected fields**: - ``echo`` — rejected with 400 ``unsupported_field``. - ``suffix`` — rejected with 400 ``unsupported_field``. - ``logprobs`` — rejected with 400 ``unsupported_field`` (the legacy ``{tokens, token_logprobs}`` response shape is a follow-up; chat ``logprobs`` is available on ``/v1/chat/completions``). - ``best_of`` — rejected with 400 ``unsupported_field`` (use chat). - ``n > 1`` — rejected with 400 ``unsupported_field`` (chat is the multi-candidate surface). ``n == 1`` (or absent) is a no-op. - Batched array ``prompt`` — rejected with 400 ``unsupported_field``; send one prompt string. **Streaming:** ``stream: true`` is supported (SSE ``text_completion``). **Response body wire change:** the always-null ``logprobs`` field has been dropped from the response body; SDKs that destructure ``choices[].logprobs`` should treat absence as the new normal.
  - `frequency_penalty` number, float, nullable — In ``[-2.0, 2.0]``; out-of-range or non-numeric values yield 400.
  - `max_tokens` integer, nullable — Maximum number of generated tokens. Defaults to 16 when absent or null.
  - `model` string, required
  - `n` integer, nullable — Single-candidate only: integer `1` (or absent) accepted; `n > 1` rejects with 400 unsupported_field (use chat for multi-candidate). `n == 0` rejects with 400 invalid_request.
  - `presence_penalty` number, float, nullable — In ``[-2.0, 2.0]``; out-of-range or non-numeric values yield 400.
  - `prompt` string, required — Single prompt string. Batched array prompts reject with 400 ``unsupported_field``.
  - `seed` integer, nullable — Optional signed 64-bit per-request sampling seed. Reproducibility is best effort, not guaranteed, and depends on the active generation backend and deployment configuration. Non-integer or out-of-range values reject with 400 invalid_request.
  - `stop` union — Either a string or an array of strings, mirroring OpenAI.
    - string
    - string[]
  - `stream` boolean, nullable — SSE streaming. When true, the response is a stream of `text_completion` events terminated by `data: [DONE]`. Non-boolean values reject with 400 invalid_request.
  - `temperature` number, float, nullable — Sampling temperature representable by the worker runtime.
  - `top_p` number, float, nullable — Nucleus sampling. Finite number in ``(0, 1]``.

## Response `200`

Text completion response

## Other responses

- `400` — Invalid or unsupported request
- `401` — Missing or invalid bearer token (inference token)
- `404` — Model not found
- `500` — Worker emitted malformed response; gateway auth enabled but no tokens configured
- `503` — Provisioning in progress, queue unavailable, or model loading

## Changes

- **2026-08-06** `90d90a11ff95` — 2 breaking, 3 warning
  - the `max_tokens` request property's min was increased to `1.00`
  - the `max_tokens` request property type/format changed from `integer, null`/`int32` to `integer, null`/``
  - the `max_tokens` request property's max was set to `4294967295.00`
  - the `temperature` request property's max was set to `3.4028234663852886e+38`
  - …1 more
- **2026-07-22** `9f3153c32a93` — 2 warning
  - the `seed` request property's max was set to `9223372036854775808.00`
  - the `seed` request property's min was set to `-9223372036854775808.00`
- **2026-05-27** `d145a90eb76e` — 1 info
  - endpoint added
- **2026-05-08** `a499d5bea359` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/superlinked/apis/sie-gateway/changes/v1/completions/post.md)

---

[API](https://skmtc.dev/superlinked/apis/sie-gateway.md) · [All operations](https://skmtc.dev/superlinked/apis/sie-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/superlinked/sie-gateway/revisions/78eeecd83405/schema)
