Skip to main content
Call the SDK’s responses method to send 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 in output 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.
Keep the full response when a request can return several messages, reasoning items, tool calls, or provider metadata.

Send function tools

The request body is the same in every SDK. In Rust:
Rust
For a local tool loop with approvals and resumable state, use the Agent SDK.

Parameters

Field names are the JSON body fields in every SDK. Go’s typed phaseo.ResponsesRequest uses PascalCase struct fields (Model, Input). Parameters explains each field, and the Responses API reference has the full schema.

Response

ResponsesResponse:
With 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:
Last modified on November 5, 2026