An overview of Requestys API
/v1/chat/completions
closely follows the OpenAI Chat Completion schema:
messages
: An array of message objects with role
and content
user
, assistant
, system
, or tool
model
: The model name. If omitted, defaults to the user’s or payer’s default model. Here is a full list of the supported modelsprompt
: Alternative to messages
for some providers.stream
: A boolean to enable Server-Sent Events (SSE) streaming responses.max_tokens
, temperature
, top_p
, etc.: Standard language model parameters.tools / functions
: Allows function calling with a schema defined. See OpenAI’s function calling documentation for the structure of these requests.tool_choice
: Specifies how tool calling should be handled.response_format
: For structured responses (some models only).get_current_weather
) that the model can call if it decides the user request involves weather data.
Some request fields require a different function, for example if you use response_format
you’ll need to update the request to client.beta.chat.completions.parse
and you may want to use the Pydantic or Zod format for your structure.
stream: true
, responses arrive incrementally as SSE events with data: lines
. See Streaming for documentation on streaming.function_call
in the assistant message. You then execute the tool, append the tool’s result as a role: "tool"
message, and send a follow-up request. The LLM will then integrate the tool output into its final answer.