Skip to main content

Authentication

All requests require an API key in the x-api-key header:

Search Endpoint

POST /v1/search

Search the web and return matching documents.

Request Body

Filter examples:

Response

Answer Endpoint

POST /v1/answer

Generate a direct, natural-language answer to a question, grounded in live web search results, with citations to the sources used.

Request Body

With the pro tier:
With cited content:
With structured output:
With a system prompt:

Response

The answer field is markdown-formatted text, unless response_format requested structured output — then it is a JSON string matching your schema. Each citation’s content is populated only when include_content is true.

Error Responses

Errors return an HTTP status code and a JSON body carrying a stable error.code to branch on:
See Errors for the full status code reference, the 8 KiB limit on /answer’s query and system_prompt, and how streaming errors differ.

Environment Variables

Store your API key securely: