Skip to main content
POST
Create a response
Download the OpenAPI schema for code generation and client libraries.
Model APIs accept requests in the OpenAI Responses API format at 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 call responses.create:
To call a model with the Responses API:
responses.py
The remaining Python examples on this page reuse client from this section.

Use with the OpenAI Agents SDK

Configure the Agents SDK to use the Responses API, then pass the model as an OpenAIResponsesModel. 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:
agent.py
Tool calls, multi-turn runs, and streaming work through 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 previous output back as part of input:
continue.py

Stream responses

Set stream 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:
stream.py

Call function tools

Declare function tools in tools, 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:
tools.py

Return structured output

Set text.format to a JSON schema to constrain the message text:
structured.py

Unsupported fields

Baseten serves Responses statelessly, so fields that depend on stored state aren’t supported. The endpoint rejects requests that set previous_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

application/json
model
string
required

Model slug, such as zai-org/GLM-5.3.

input
required

A prompt string, or a list of input items.

instructions
string

System-level instructions for the request.

max_output_tokens
integer

Upper bound on generated tokens, including reasoning tokens.

Required range: x >= 1
temperature
number<float>
default:1

Sampling temperature, from 0 to 2.

Required range: 0 <= x <= 2
top_p
number<float>
default:1

Nucleus sampling threshold, from 0 to 1.

Required range: 0 <= x <= 1
stream
boolean
default:false

Stream server-sent events instead of returning one JSON object.

tools
object[]

Function tools the model can call.

tool_choice

Whether the model calls a tool. auto lets the model decide, required forces a call, none forbids one.

Available options:
auto,
required,
none
parallel_tool_calls
boolean
default:true

Lets the model emit more than one function call in a response.

text
object

Output format for the message text.

reasoning
object

Reasoning settings for models that expose them.

metadata
object

Up to 16 key-value pairs, echoed back on the response.

truncation
enum<string>
default:disabled

auto or disabled.

Available options:
auto,
disabled

Response

The completed response, or a server-sent event stream when stream is true.

id
string
required

Response identifier, prefixed resp_.

object
enum<string>
required
Available options:
response
created_at
integer
required
status
enum<string>
required
Available options:
completed,
incomplete,
failed,
in_progress
model
string
required
output
object[]
required

Output items in the order the model produced them.

completed_at
integer | null
usage
object | null
incomplete_details
object | null
error
object | null
metadata
object
instructions
string | null
max_output_tokens
integer | null
parallel_tool_calls
boolean
temperature
number<float>
top_p
number<float>
tool_choice
string
tools
object[]
truncation
string
service_tier
string
text
object
reasoning
object | null