Search the web and get AI-powered answers with real-time information
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | ✅ Yes | gpt-4.1 | The model to use for the request. Web search functionality is available for all models. |
input | array | ✅ Yes | - | Array of message objects with role and content. Each message contains: - role: “user” or “assistant” - content: Array of content objects with the following type: - input_text: Text input with text field containing your search query or question Example: json [ { "role": "user", "tools": [ { "type": "web_search_preview" } ], "content": [ { "type": "input_text", "text": "What are the latest developments in artificial intelligence in 2025?" } ] } ] |
tools | array | ✅ Yes | - | Array of tool objects to enable special capabilities. For web search functionality, include: json [ { "type": "web_search_preview" } ] Available tool types: - web_search_preview: Enables real-time web search to enhance responses with current information |
stream | boolean | ❌ No | false | Whether to stream the response |