Direct Web Search API
Endpoint Examples
Direct Web Search API
Run direct web search requests with explicit query control, Linkup output formats, and normalized metadata
POST
Direct Web Search API
Overview
UsePOST /api/web when you want direct control over search requests and output formatting.
You can also call this tool through the unified Data API at POST /api/v1/data/web/search. The Data API preserves this endpoint’s request body, response body, billing, and provider behavior while adding discovery and dispatch metadata.
For chat-first workflows, use POST /api/v1/chat/completions with model suffixes like :online, :online/linkup, or :online/linkup-deep, including provider-specific suffixes such as :online/exa-instant, :online/exa-deep-reasoning, :online/brave, and :online/valyu-web-deep. See Model Suffixes.
When to use which endpoint
| Use case | Endpoint |
|---|---|
| You want the model to answer with web context in one call | POST /api/v1/chat/completions + :online... |
| You want one discoverable endpoint family for data tools | POST /api/v1/data/web/search |
You need explicit control over query, outputType, domain/date filters, or structured schema output | POST /api/web |
| You need OpenAI-native web search | POST /api/v1/chat/completions only |
Authentication
Either auth header is supported:Bearer
YOUR_API_KEYYOUR_API_KEYAccountless x402 Payment
For accountless payment, prefer the public Data API path:402 Payment Required with a top-level payment quote when the request is unauthenticated and can be quoted. See Accountless x402 API Payments and GET /api/v1/x402/endpoints for the current endpoint matrix.
Request body
Search query string.
Search provider.
openai-native is not allowed on /api/web.Search depth. For Linkup:
standard or deep.For Linkup,
depth: "standard" is executed as Linkup fast under the hood.Output mode. Allowed values:
searchResults, sourcedAnswer, structured.Required when
outputType is structured. Pass a JSON schema string.Include image results.
Earliest result date (
YYYY-MM-DD).Latest result date (
YYYY-MM-DD).Restrict results to these domains.
Exclude these domains.
Linkup supports
outputType: "searchResults", "sourcedAnswer", and "structured".
Non-Linkup providers currently support only outputType: "searchResults".Response shape
Provider-formatted payload.
searchResults, data is an array of normalized results.
For sourcedAnswer and structured, data is the provider response object.
Example response
Pricing (hosted key)
| Mode | Price |
|---|---|
| Linkup standard | $0.006 |
| Linkup deep | $0.06 |
Error codes
| HTTP status | Meaning |
|---|---|
400 | Invalid parameters |
401 | Invalid session or auth |
402 | Insufficient balance or usage cap |
429 | Rate limited |
503 | Provider key missing |
504 | Search failed or timed out |