Sample usage for OpenAI APIs
The responses_api_examples.py
script shows how to:
- send a basic prompt using the
responses
endpoint - retrieve a response by ID to demonstrate stateful behavior
- continue a conversation by referencing
previous_response_id
- call the built-in
web_search
tool
Run the script after setting OPENAI_API_KEY
in your environment.