Skip to content

Responses Interaction Example

Back to OpenAI Responses.

This compact example mirrors the detailed Chinese walkthrough. It shows why Responses is item-oriented: hosted tools, function calls, and assistant messages all appear as output items.

  1. 1
    client request

    Client sends `input`, a `function` tool, a hosted `web_search` tool, and `stream: true`.

  2. 2
    response.created

    The stream starts a response resource with `status: in_progress`.

  3. 3
    hosted tool events

    `response.web_search_call.*` events report hosted tool lifecycle by `item_id` and `output_index`.

  4. 4
    function_call item

    `response.output_item.added` creates a function call item; argument deltas join by `item_id`.

  5. 5
    function_call_output

    The next request sends the local tool result using the function call `call_id`.

  6. 6
    final message item

    The final turn emits a message item, text deltas, `output_text.done`, and `response.completed`.

EntityStable keyNotes
responseresponse.idCan connect follow-up calls via previous_response_id.
output itemitem_id plus output_indexitem_id is the primary join key for deltas.
function resultcall_idThe client returns tool output with function_call_output.call_id.
content partitem_id + content_indexText deltas and done events target one content part.