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
Authentication
Either auth header is supported:Bearer
YOUR_API_KEYYOUR_API_KEYAccountless x402 Payment
For accountless payment, prefer the public Data API path:Authorization or x-api-key, and include x-x402: true. NanoGPT will return 402 Payment Required with available payment options. This endpoint supports accountless x402 payments where listed by GET /api/v1/x402/endpoints, including Lightning L402 when advertised. See Accountless x402 API Payments for the full flow.
If you receive 401 missing_api_key immediately, check that the initial quote request includes x-x402: true. Without that header, NanoGPT does not enter the x402 quote flow.
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.