Skip to main content

Request

Response


Parameters

spend-logs-metadata
header
An optional header used for spend logging metadata, containing JSON properties like user_id, project_id, and env.
model
string
required
Name of the model to use (for example: gpt-5-mini). To see the complete list of supported models, visit: https://znapai.com/models/chat
input
string | array
required
The user input. Can be a plain string for simple text prompts, or an array of message objects for multimodal and multi-turn conversations.
temperature
number
Controls output randomness between 0 and 2. Lower values (like 0.2) make the output more deterministic, higher values (like 1.8) make it more creative.Default: 1.0
max_tokens
integer
The maximum number of tokens to generate. Different models have different maximum limits.
stream
boolean
Whether to stream the response as it is generated (SSE format).Default: false
top_p
number
Controls diversity via nucleus sampling (range 0 to 1). Recommended to set either temperature or top_p, but not both.Default: 1.0
reasoning
object
Controls reasoning effort for supported models (e.g. gemini-2.5-flash, o3).
tools
array
A list of tools available for the model to extend its capabilities.

Usage examples

PDF / File understanding

Upload or reference a document and ask questions about it.

Advanced reasoning

Use higher reasoning effort for complex tasks.

Function calling

Allow the model to invoke custom functions.
Enable live web search capabilities.

Image understanding

Analyze images and answer questions about them.

Params to Avoid