tools array in your request to POST /v1/chat/completions. Instead of returning a plain text reply, the model will return structured JSON arguments matching the schema you define — it is your responsibility to execute the function and, if needed, send the result back in a follow-up message.
For a deeper conceptual overview of how function calling works, see the OpenAI Function Calling Guide.
Request
POST https://kiosapi.com/v1/chat/completions
Headers
Request Body
string
required
The model to use for the request (e.g.
gpt-4o).array
required
An array of message objects representing the conversation history so far.
array
required
An array of tool definitions that the model may call. Each element describes one callable function.
Example Request
- cURL
- Python
Response
When the model decides to call a function, the response contains atool_calls array in the message object rather than a text content value.
Response Fields
array
Present when the model wants to invoke one or more functions. Each element contains an
id, a type of "function", and a function object with name and arguments (a JSON-encoded string).string
Set to
"tool_calls" when the model is requesting a function invocation rather than producing a final text response.