pydo.responses.create()
Generated on 3 Aug 2026
from pydo version
v0.40.0
Usage
client.responses.create(
model="openai-gpt-oss-20b",
input="What is the capital of France?",
max_output_tokens=50,
temperature=0.7,
)Serverless inference methods can authenticate with a model access key instead of a DigitalOcean API token:
client = Client(token=os.environ.get("MODEL_ACCESS_KEY"))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.inputobject 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_choiceobject optionalControls which (if any) tool is called by the model.
Show child properties
typestring requiredExample:
functionfunctionobject requiredShow child properties
namestring requiredExample:
get_weatherThe name of the function to call.
stopobject 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.