Creates a raw text completion for the given prompt

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.

post/v1/completions

Request body

modelstring required

ID of the model to use (LLM only)

promptstring required

The prompt to complete, passed to the model verbatim (no chat template). A single-element string array is also accepted.

max_tokensinteger

The maximum number of tokens to generate

suffixstring

Not supported — include the model's FIM tokens in prompt instead

echoboolean

Echo back the prompt in addition to the completion

temperaturenumber float

What sampling temperature to use, between 0 and 2

top_pnumber float

An alternative to sampling with temperature, called nucleus sampling

seedinteger

Best-effort deterministic sampling seed

presence_penaltynumber float

Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far

frequency_penaltynumber float

Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far

streamboolean

If set, partial text deltas will be sent

top_kinteger

An alternative to sampling with temperature, called top-k sampling

min_pnumber float

Minimum token probability, scaled by the probability of the most likely token

repetition_penaltynumber float

The parameter for repetition penalty. 1.0 means no penalty

nctxinteger

Context window size (llama_cpp only). Omit to use the server default set via geniex serve --nctx / GENIEX_NCTX (4096 out of the box).

nglinteger

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.

Example request

{
  "model": "qualcomm/Qwen3-4B-Instruct-2507",
  "prompt": "def fibonacci(n):",
  "max_tokens": 64,
  "temperature": 0.2,
  "stream": false
}

Response

Successful response for non-streaming requests

objectstring

Example response

{
  "object": "text_completion"
}

Changes

Changed in 3 of the 14 revisions of this API.12