POST /v1/responses and get one completed response.
Stream the response
Each parsed event (TypeScript and Python) keeps its original fields (
type, delta, …) and adds text, usage and reasoning tokens (reasoningTokens / reasoning_tokens). text holds only new text: it is empty on .done events and response.completed, which repeat text you already have, and a .done event’s full text is in fullText / full_text.
With raw SSE lines (C#, PHP, Ruby, Java), parse each data: line as JSON and handle event names, event types such as response.output_text.delta and response.completed, and completion markers yourself. The streaming methods set stream: true for you, so don’t set it in the request.
Read the output text
The output is an array of items. Text is inoutput items with type message, function calls in items with type function_call, and token counts in usage. Python’s resp.output_text joins the text for you.
Send function tools
The request body is the same in every SDK. In Rust:Rust
Parameters
Field names are the JSON body fields in every SDK. Go’s typedphaseo.ResponsesRequest uses PascalCase struct fields (Model, Input).
Parameters explains each field, and the Responses API reference has the full schema.
Response
ResponsesResponse:
stream: true, the endpoint sends typed SSE events. Text arrives in response.output_text.delta events, and the final response.completed event carries the whole response with usage: