inferenceClient.responses.create()
Generated on 27 Oct 2026
from DoTs version
v1.21.0
Usage
inferenceClient.responses.create(params: Record<string, any>, streamCallbacks?: InferenceStreamCallbacks): Promise<any>Description
Generate text responses from text prompts. This endpoint supports both streaming and non-streaming responses for supported text models.
Parameters
modelstring requiredExample:
openai-gpt-oss-20bThe model ID of the model you want to use. Get the model ID using
/v1/modelsor on the available models page.inputstring or array of objects requiredThe prompt or input content you want the model to respond to. Can be a simple text string or an array of message objects for conversation context.
max_output_tokensinteger or null optionalExample:
50The maximum number of tokens to generate in the response.
temperaturenumber or null optionalExample:
0.7A value between 0.0 and 2.0 to control randomness and creativity. Lower values like 0.2 make the output more focused and deterministic, while higher values like 0.8 make it more random.
streamboolean or null optionalExample:
falseSet to true to stream partial responses as Server-Sent Events.
instructionsstring or null optionalExample:
You are a helpful assistant.System-level instructions for the model. This sets the behavior and context for the response generation.
top_pnumber or null optionalExample:
1An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
stream_optionsobject or null optionalOptions for streaming response. Only set this when you set stream to true.
Show child properties
include_usageboolean optionalExample:
trueIf set, an additional chunk will be streamed before the data: [DONE] message with token usage statistics for the entire request.
toolsarray of objects or null optionalA list of tools the model may call.
Show child properties
typestring requiredExample:
functionThe type of the tool.
namestring optionalExample:
get_weatherThe name of the function to be called.
descriptionstring optionalExample:
Get the current weather in a given location.A description of what the function does.
parametersobject optionalThe parameters the function accepts, described as a JSON Schema object.
tool_choicestring or object optionalControls which (if any) tool is called by the model.
Show child properties
typestring optionalExample:
functionfunctionobject optional
stopstring or array of strings or null optionalUp to 4 sequences where the API will stop generating further tokens.
metadataobject or null optionalExample:
{"session_id": "abc123"}Set of key-value pairs that can be attached to the request.
userstring or null optionalExample:
user-1234A unique identifier representing your end-user.
Request Sample
Response Example
More Information
See /v1/responses in the API reference for additional detail on responses, headers, parameters, and more.