Skip to main content
POST
Direct Web Search API

Overview

Use POST /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:
Authorization
string
Bearer YOUR_API_KEY
x-api-key
string
YOUR_API_KEY

Accountless x402 Payment

For accountless payment, prefer the public Data API path:
To request an accountless x402 quote, send the API request without 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

query
string
required
Search query string.
provider
string
default:"linkup"
Search provider. openai-native is not allowed on /api/web.
depth
string
default:"standard"
Search depth. For Linkup: standard or deep.
For Linkup, depth: "standard" is executed as Linkup fast under the hood.
outputType
string
default:"searchResults"
Output mode. Allowed values: searchResults, sourcedAnswer, structured.
structuredOutputSchema
string
Required when outputType is structured. Pass a JSON schema string.
includeImages
boolean
default:false
Include image results.
fromDate
string
Earliest result date (YYYY-MM-DD).
toDate
string
Latest result date (YYYY-MM-DD).
includeDomains
string[]
Restrict results to these domains.
excludeDomains
string[]
Exclude these domains.
Linkup supports outputType: "searchResults", "sourcedAnswer", and "structured". Non-Linkup providers currently support only outputType: "searchResults".

Response shape

data
array|object
Provider-formatted payload.
metadata
object
For searchResults, data is an array of normalized results. For sourcedAnswer and structured, data is the provider response object.

Example response

Pricing (hosted key)

Error codes

Examples