---
title: "Creates a raw text completion for the given prompt"
method: POST
path: "/v1/completions"
---

# Creates a raw text completion for the given prompt

`POST /v1/completions`

Generates a continuation of the prompt with no chat template applied —
the prompt is passed to the model verbatim. Intended for clients that
build the full prompt themselves, e.g. editor fill-in-the-middle (FIM)
code autocompletion; include the model's FIM tokens in `prompt`
directly. LLM models only.

## Request body

- CompletionRequest
  - `model` string, required — ID of the model to use (LLM only)
  - `prompt` string, required — The prompt to complete, passed to the model verbatim (no chat template). A single-element string array is also accepted.
  - `max_tokens` integer — The maximum number of tokens to generate
  - `suffix` string — Not supported — include the model's FIM tokens in `prompt` instead
  - `echo` boolean — Echo back the prompt in addition to the completion
  - `stop` union — Sequences where generation stops; the returned text does not contain them
    - string
    - string[]
  - `temperature` number, float — What sampling temperature to use, between 0 and 2
  - `top_p` number, float — An alternative to sampling with temperature, called nucleus sampling
  - `seed` integer — Best-effort deterministic sampling seed
  - `presence_penalty` number, float — Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far
  - `frequency_penalty` number, float — Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far
  - `stream` boolean — If set, partial text deltas will be sent
  - `stream_options` object — Options for streaming responses. Only used when stream is true.
    - `include_usage` boolean — If set, an additional chunk will be streamed with token usage statistics for the entire request
  - `top_k` integer — An alternative to sampling with temperature, called top-k sampling
  - `min_p` number, float — Minimum token probability, scaled by the probability of the most likely token
  - `repetition_penalty` number, float — The parameter for repetition penalty. 1.0 means no penalty
  - `nctx` integer — Context window size (llama_cpp only). Omit to use the server default set via `geniex serve --nctx` / `GENIEX_NCTX` (4096 out of the box).
  - `ngl` integer — Number of GPU/NPU layers to offload (llama_cpp only). Omit to use the server default set via `geniex serve --ngl` / `GENIEX_NGL` (999 out of the box); the server chooses the correct layout per backend.
  - `compute` 'cpu' | 'gpu' | 'npu' | 'hybrid' — Compute unit to run on. Omit to use the server default set via `geniex serve --compute` / `GENIEX_COMPUTE`. QAIRT is NPU-only; other aliases are coerced with a warning.

## Response `200`

Successful response for non-streaming requests

- CompletionResponse
  - `object` string
  - `choices` object[]
    - `index` integer
    - `text` string — The generated continuation of the prompt
    - `finish_reason` 'stop' | 'length'
  - `usage` TokenUsage
    - `prompt_tokens` integer — Number of tokens in the prompt
    - `completion_tokens` integer — Number of tokens in the generated completion
    - `total_tokens` integer — Total number of tokens used in the request

## Changes

- **2026-08-24** `986970b792d7` — 1 info
  - endpoint added
- **2026-08-10** `ce5be69ae02e` — 1 breaking
  - api path removed without deprecation
- **2026-08-10** `b20ded710216` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/qualcomm/apis/geniex-server/changes/v1/completions/post.md)

---

[API](https://skmtc.dev/qualcomm/apis/geniex-server.md) · [All operations](https://skmtc.dev/qualcomm/apis/geniex-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qualcomm/geniex-server/revisions/47b5a34b747b/schema)
