Skip to main content
The /v1/chat/completions endpoint is the primary interface for generating text with any chat model on KiosAPI — including GPT, Claude, Gemini, and others. Every model uses the same standard OpenAI request format, so you can switch between providers by changing the model field alone, with no other code changes required.
OpenAI, Claude, Gemini, and other chat models all share this endpoint format. For a full parameter reference and advanced usage patterns, see the official OpenAI Chat API documentation.

Request

Endpoint: POST https://kiosapi.com/v1/chat/completions

Headers

Request Body

string
required
The model to use for the completion, e.g. gpt-4o. You can retrieve the full list of available model IDs from the List Models endpoint.
array
required
An ordered array of message objects forming the conversation history.
number
Sampling temperature between 0 and 2. Higher values produce more varied output; lower values produce more deterministic output. Defaults to 1.
number
Nucleus sampling probability mass. An alternative to temperature — only tokens comprising the top top_p probability mass are considered. Avoid setting both temperature and top_p at the same time.
boolean
When true, the response is streamed back as server-sent events. Defaults to false.
number
The maximum number of tokens to generate in the completion. The request will be cut off once this limit is reached.
number
How many independent completion choices to generate for each request. Defaults to 1.
number
A value between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the conversation so far, increasing the model’s likelihood to introduce new topics.
number
A value between -2.0 and 2.0. Positive values penalize new tokens based on their frequency in the conversation so far, reducing repetition.
object
Configuration object for structured output. For example, set { "type": "json_object" } to enable JSON mode.
array
One or more sequences at which the model will stop generating further tokens. Accepts a string or an array of up to four strings.
string
An opaque identifier representing your end user. Useful for abuse monitoring and associating completions with specific users in your system.

Examples

Response

A successful request returns a chat completion object containing the generated message along with token usage statistics.

Response Fields

string
required
Unique identifier for this completion, prefixed with chatcmpl-.
string
required
Always "chat.completion".
integer
required
Unix timestamp (seconds) of when the completion was created.
string
required
The exact model version used to generate the response, which may differ from the model ID you requested.
array
required
Array of completion choices. Contains one entry by default, or more if you set n greater than 1.
object
required
Token consumption for this request, useful for cost tracking.