Send a simple prompt
Pass a string ininput for a single-turn request.
The response includes generated text in output_text.
X-On-Behalf-Of.
Add instructions
Useinstructions to define behavior before the model sees the user input.
Keep instructions short and specific.
Send structured messages
Use an array of message items ininput when you want explicit roles.
Each message item uses type, role, and content.
Continue a multi-turn exchange
Useprevious_response_id to continue from an earlier response without resending the full history.
conversation.
Stream text as it is generated
Setstream to true to receive server-sent events instead of waiting for the full response.
Next steps
- Review the API overview for authentication and base URL details
- See background responses when you need to offload long-running work and poll or stream for results
- See manage conversations to organize multi-turn exchanges into reusable conversation containers
- See spawn subagents using the Responses API for a recipe that runs nested Responses calls as tool work