Responses
Create OpenAI Responses API requests against Baseten Model APIs, including streaming, function tools, and structured outputs.
https://inference.baseten.co/v1/responses. Use it for the OpenAI Agents SDK and other clients built on the Responses API. Requests are stateless: send the full conversation as input on every call.
Call with the OpenAI SDK
Point the OpenAI client at Baseten and callresponses.create:
- Python
- JavaScript
- cURL
client from this section.
Use with the OpenAI Agents SDK
Configure the Agents SDK to use the Responses API, then pass the model as anOpenAIResponsesModel. Agent model names are parsed as <provider>/<model> strings, so a Baseten slug such as zai-org/GLM-5.3 fails with Unknown prefix: zai-org if you pass it as a string. Build the model object instead:
Runner.run and Runner.run_streamed.
Requests are stateless
Baseten stores no response and exposes no retrieval endpoint, so a request can’t refer to an earlier response. To continue a conversation, send the previousoutput back as part of input:
Stream responses
Setstream to receive server-sent events. Each event carries a type and a sequence_number; token deltas arrive as response.output_text.delta, and the response closes with response.completed:
Call function tools
Declare function tools intools, then send the model’s call and your function’s result back as input items. A function_call item carries the arguments as a JSON string:
Return structured output
Settext.format to a JSON schema to constrain the message text:
Unsupported fields
Baseten serves Responses statelessly, so fields that depend on stored state aren’t supported. The endpoint rejects requests that setprevious_response_id, conversation, background, or prompt with HTTP 501; send the full prompt and prior turns as input instead.
The endpoint accepts store, but there is no GET /v1/responses/{id} to retrieve a stored response. Store the response yourself if you need to refer to it later.Body
Model slug, such as zai-org/GLM-5.3.
A prompt string, or a list of input items.
System-level instructions for the request.
Upper bound on generated tokens, including reasoning tokens.
x >= 1Sampling temperature, from 0 to 2.
0 <= x <= 2Nucleus sampling threshold, from 0 to 1.
0 <= x <= 1Stream server-sent events instead of returning one JSON object.
Function tools the model can call.
Whether the model calls a tool. auto lets the model decide, required forces a call, none forbids one.
auto, required, none Lets the model emit more than one function call in a response.
Output format for the message text.
Reasoning settings for models that expose them.
Up to 16 key-value pairs, echoed back on the response.
auto or disabled.
auto, disabled Response
The completed response, or a server-sent event stream when stream is true.
Response identifier, prefixed resp_.
response completed, incomplete, failed, in_progress Output items in the order the model produced them.
- Option 1
- Option 2
- Option 3