Overview
The Agentic Research API provides two powerful tools that third-party models can use to access real-time web information:web_search- Performs web searches to retrieve current information with advanced filtering optionsfetch_url- Fetches and extracts content from specific URLs
Tool: web_search
Theweb_search tool allows models to perform web searches with all the filtering capabilities of the Search API.
Pricing
Web search pricing is **0.005 per search). Additionally, you are charged for the tokens consumed when search results are embedded in the model’s context. For full pricing details, see our Pricing page. Cost Example: If a model makes 3 web searches and receives 1,800 tokens of search results, plus your original 100-token query, usingopenai/gpt-5.2:
- Tool calls: 3 searches × 0.015
- Input tokens: 1,900 tokens × (0.003325
- Output tokens: 300 tokens × (0.0042
- Total cost: $0.022525
Basic Usage
Search Filters
Theweb_search tool supports all Search API filters. Configure them in the filters object within the tool definition.
Available Filters
| Filter | Type | Description | Limit |
|---|---|---|---|
search_domain_filter | Array of strings | Filter by specific domains (allowlist or denylist with - prefix) | Max 20 domains |
search_language_filter | Array of strings | Filter by ISO 639-1 language codes | Max 10 languages |
search_recency_filter | String | Filter by time period: "day", "week", "month", "year" | - |
search_after_date | String | Filter results published after this date (format: "M/D/YYYY") | - |
search_before_date | String | Filter results published before this date (format: "M/D/YYYY") | - |
last_updated_after_filter | String | Filter results last updated after this date (format: "M/D/YYYY") | - |
last_updated_before_filter | String | Filter results last updated before this date (format: "M/D/YYYY") | - |
Examples with Filters
Domain Filtering
Filter search results to specific trusted sources:Language Filtering
Search across multiple languages:Recency Filtering
Filter by time period for recent information:Date Range Filtering
Filter by specific publication dates:Combining Multiple Filters
Combine filters for precise control:User Location
Configure user location for localized search results:Token Control
Control the amount of content retrieved per search result:Tool: fetch_url
Thefetch_url tool fetches and extracts content from specific URLs provided by the model.
Pricing
URL fetch pricing is **0.0005 per fetch). Additionally, you are charged for the tokens consumed when fetched content is embedded in the model’s context. For full pricing details, see our Pricing page. Cost Example: If a model fetches 2 URLs with 3,000 tokens of content, plus your original 80-token query, usinganthropic/claude-sonnet-4-5:
- Tool calls: 2 fetches × 0.001
- Input tokens: 3,080 tokens × (0.009240
- Output tokens: 500 tokens × (0.0075
- Total cost: $0.01774
Basic Usage
Use Cases
- Article Summarization: Fetch and summarize specific articles or blog posts
- Documentation Analysis: Extract and analyze technical documentation
- Content Comparison: Compare content from multiple specific URLs
- URL Validation: Verify content at specific URLs before sharing
Combining Both Tools
Use both tools together for comprehensive information gathering:Best Practices
Effective Instructions
Provide clear instructions to guide tool usage:Filter Selection
- Domain Filtering: Use for trusted sources or to exclude low-quality sites
- Language Filtering: Essential for multilingual research or regional content
- Recency Filtering: Best for news, trends, and time-sensitive information
- Date Range Filtering: Ideal for historical research or specific time periods
Cost Management
- Minimize tool calls:
web_searchcosts 0.0005/call - Set
max_tokens_per_page: Control the token costs of search results embedded in context - Use specific filters: Reduce unnecessary searches with precise filtering
- Combine filters: Narrow results to the most relevant content, reducing both tool calls and token consumption