Request
Response
Parameters
header
An optional header used for spend logging metadata, containing JSON properties like
user_id, project_id, and env.string
required
Name of the model to use (for example: gpt-4o-mini). To see the complete list of supported chat models, visit: https://znapai.com/models/chat
array
required
A list of messages comprising the conversation so far.Example:Advanced usage:Add system prompt (to define AI behavior):
number
default:"1.0"
Controls output randomness, range 0-2
- Lower values (e.g., 0.2) make output more deterministic
- Higher values (e.g., 1.8) make output more random
number
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
integer
Maximum number of tokens to generateDifferent models have different maximum limits, please refer to specific model documentation
number
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim.
number
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics.
integer
How many chat completion choices to generate for each input message.
boolean
If set, partial message deltas will be sent, like in ChatGPT.
string | array
Up to 4 sequences where the API will stop generating further tokens.
