---
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

---

[API](https://skmtc.net/superlinked/apis/sie-gateway.md) · [All operations](https://skmtc.net/superlinked/apis/sie-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/superlinked/sie-gateway/versions/840fee92bd27/schema)
