Web Search

Real-time web search integration with the Responses API Beta

Beta API

This API is in beta stage and may have breaking changes.

The Responses API Beta supports web search integration, allowing models to access real-time information from the internet and provide responses with proper citations and annotations.

Web Search Plugin

Enable web search using the plugins parameter:

Plugin Configuration

Configure web search behavior:

ParameterTypeDescription
idstringRequired. Must be “web”
max_resultsintegerMaximum search results to retrieve (1-10)

Use structured messages for more complex queries:

Online Model Variants

Some models have built-in web search capabilities using the :online variant:

Response with Annotations

Web search responses include citation annotations:

Annotation Types

Web search responses can include different annotation types:

URL Citation

Complex Search Queries

Handle multi-part search queries:

Web Search in Conversation

Include web search in multi-turn conversations:

Monitor web search progress with streaming:

Annotation Processing

Extract and process citation information:

Best Practices

  1. Limit results: Use appropriate max_results to balance quality and speed
  2. Handle annotations: Process citation annotations for proper attribution
  3. Query specificity: Make search queries specific for better results
  4. Error handling: Handle cases where web search might fail
  5. Rate limits: Be mindful of search rate limits

Next Steps