Creates a model response for the given chat conversation

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 body

modelstring required

ID of the model to use

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

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 (default); deepseek / deepseek-legacy / auto move it to message.reasoning_content. Ignored for tool-call requests.

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_pathstring

Path to the grammar file for structured output

grammar_stringstring

Grammar string for structured output

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.

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 or set to empty to disable. draft-* variants require spec_draft_model; ngram-* variants are self-speculative.

spec_draft_modelstring

Draft/MTP model for draft-* spec types (llama_cpp only). 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). Default 3 when omitted.

spec_n_mininteger

Min draft tokens per verification step (llama_cpp only). 0 = llama.cpp default.

spec_p_minnumber float

Min greedy draft probability (llama_cpp only). 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

Changed in 7 of the 14 revisions of this API.944

    • added the new optional request property

      new-optional-request-property

    • removed the request property

      request-property-removed

    • removed the request property

      request-property-removed

    • added the new optional request property //

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the optional property /// to the response with the status

      response-optional-property-added

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • the request property default value 4096 was removed

      request-property-default-value-removed

  • e100892beaa5514See the full diff
    • removed the request property

      request-property-removed

    • removed the request property

      request-property-removed

    • removed the request property

      request-property-removed

    • removed the request property

      request-property-removed

    • removed the request property

      request-property-removed

    • added the new optional request property

      new-optional-request-property

    • the request property default value changed from {"role":"user","content":"What is the weather like in Boston today?"} to {"role":"user","content":"Hello! Briefly introduce yourself."}

      request-property-default-value-changed

    • the request property default value changed from Qwen/Qwen3-1.7B-GGUF to qualcomm/Qwen3-4B-Instruct-2507

      request-property-default-value-changed

    • the request property default value 0 was removed

      request-property-default-value-removed

    • the request property default value was removed

      request-property-default-value-removed

    • the request property default value was removed

      request-property-default-value-removed

    • the request property default value 512 was removed

      request-property-default-value-removed

    • the request property default value 0 was removed

      request-property-default-value-removed

    • the request property default value 999 was removed

      request-property-default-value-removed

    • the request property default value 0 was removed

      request-property-default-value-removed

    • the request property default value 1 was removed

      request-property-default-value-removed

    • the request property default value was removed

      request-property-default-value-removed

    • the request property default value 0 was removed

      request-property-default-value-removed

    • the response's property default value changed from {"role":"user","content":"What is the weather like in Boston today?"} to {"role":"user","content":"Hello! Briefly introduce yourself."} for the status

      response-property-default-value-changed

  • 82a379cf572b219See the full diff
    • removed the request property

      request-property-removed

    • removed the request property

      request-property-removed

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • the request property default value 0 was added

      request-property-default-value-added

    • the request property default value was added

      request-property-default-value-added

    • the request property default value was added

      request-property-default-value-added

    • the request property default value 512 was added

      request-property-default-value-added

    • the request property default value 0 was added

      request-property-default-value-added

    • the request property default value 4096 was added

      request-property-default-value-added

    • the request property default value 999 was added

      request-property-default-value-added

    • the request property default value 0 was added

      request-property-default-value-added

    • the request property default value 1 was added

      request-property-default-value-added

    • the request property default value was added

      request-property-default-value-added

    • the request property default value 0 was added

      request-property-default-value-added

    • the request property default value changed from {"role":"user","content":"Hello! Briefly introduce yourself."} to {"role":"user","content":"What is the weather like in Boston today?"}

      request-property-default-value-changed

    • the request property default value changed from qualcomm/Qwen3-4B-Instruct-2507 to Qwen/Qwen3-1.7B-GGUF

      request-property-default-value-changed

    • the response's property default value changed from {"role":"user","content":"Hello! Briefly introduce yourself."} to {"role":"user","content":"What is the weather like in Boston today?"} for the status

      response-property-default-value-changed