Creates a model response for the given chat conversation

Changed on

This endpoint generates a model response for a given conversation, which can include text and images. It supports both single-turn and multi-turn conversations and can be used for various tasks like question answering, code generation, and function calling.

post/v1/chat/completions

Request

  • The document declares no server URL.
  • Auth
    none declared

Request body

modelstring

Model to use; omit only when a server model is set via geniex serve --model / GENIEX_MODEL.

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

max_completion_tokensinteger

An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.

max_tokensinteger

Deprecated alias for max_completion_tokens, accepted for compatibility with older OpenAI clients. Ignored when max_completion_tokens is also present.

temperaturenumber float

What sampling temperature to use, between 0 and 2. Omit for the plugin default; 0 decodes greedily

top_pnumber float

An alternative to sampling with temperature, called nucleus sampling

streamboolean

If set, partial message deltas will be sent

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

enable_thinkboolean

Whether to enable thinking mode for the model

reasoning_format'none' | 'deepseek' | 'deepseek-legacy' | 'auto'

Where to put the model's chain-of-thought. none keeps it inline in message.content; deepseek (default), deepseek-legacy, and auto move it to message.reasoning_content.

top_kinteger

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

min_pnumber float

An alternative to sampling with temperature, called nucleus sampling

repetition_penaltynumber float

The parameter for repetition penalty. 1.0 means no penalty

grammar_stringstring

Inline GBNF grammar for constrained generation.

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.

power_mode'low_power_saver' | 'power_saver' | 'high_power_saver' | 'low_balanced' | 'balanced' | 'high_performance' | 'sustained_high_performance' | 'burst' | 'default'

HTP power/clock-management mode, shared by qairt and llama_cpp. Omit to use the server default set via geniex serve --power-mode / GENIEX_POWER_MODE (burst out of the box).

spec_type'' | 'draft-mtp' | 'draft-eagle3' | 'draft-simple' | 'ngram-simple' | 'ngram-map-k' | 'ngram-map-k4v' | 'ngram-mod' | 'ngram-cache'

Speculative decoding type (llama_cpp only). Omit to use the geniex serve --spec-type default (disabled out of the box); set to empty to disable for this request. draft-* variants require spec_draft_model; ngram-* variants are self-speculative.

spec_draft_modelstring

Draft/MTP model for draft-* spec types (llama_cpp only). Omit to use the geniex serve --draft-model default. Catalogue name org/repo[:precision] (must be pulled via geniex pull beforehand — the server does NOT auto-download) or absolute path to a local GGUF file.

spec_n_maxinteger

Max draft tokens per verification step (llama_cpp only). Omit to use the geniex serve --draft-tokens default (0 out of the box, which means the plugin default of 3).

spec_n_mininteger

Min draft tokens per verification step (llama_cpp only). Omit to use the geniex serve --draft-min default; 0 = llama.cpp default.

spec_p_minnumber float

Min greedy draft probability (llama_cpp only). Omit to use the geniex serve --draft-p-min default; 0 = llama.cpp default.

Example request

{
  "model": "qualcomm/Qwen3-4B-Instruct-2507",
  "messages": [
    {
      "role": "user",
      "content": "Hello! Briefly introduce yourself."
    }
  ],
  "nctx": 0,
  "max_completion_tokens": 2048,
  "temperature": 0.8,
  "top_p": 0.95,
  "stream": false,
  "enable_think": true
}

Response

Successful response for non-streaming requests

idstring

A unique identifier for the chat completion

objectstring

The object type, which is always "chat.completion"

createdinteger

The Unix timestamp (in seconds) of when the chat completion was created

modelstring

The model used for the chat completion

Changes