input array — the user’s earlier messages, the assistant’s replies, and any function-call round-trips all go back in on the next request. This page shows how to chain turns that way.
The Agent API accepts an OpenAI-compatible
previous_response_id field, but it is currently a no-op: it is not yet supported for server-side response continuation. Until it is, carry context yourself by replaying the conversation in input, as shown below.Chain turns by replaying input
Send the next turn as an input array that includes the prior turns. Each turn is a message item with a role (user or assistant). Append the new question at the end.
Next steps
Give it vision
Attach images to a request.
Shape the output
Stream output as it arrives and enforce structured JSON.