Skip to main content
Sail can search the web and return results to your application. Send a search request to the Sail API. You get back a list of results with titles, URLs, and excerpts. Web search is a plain REST endpoint, separate from inference requests. You call it on its own and choose what to do with the response.

Treat results as untrusted

Every field this endpoint returns is written by whoever published the page. Titles, URLs, and excerpts are all attacker-influenceable. Pages exist that contain text written to look like instructions to whatever reads them next. The risk is highest when you pass results to a model that can act, such as one with tools, file access, or the ability to call your own APIs. Text in a result that reads like instructions can cause an action you did not intend. Before handing results to a capable model:
  • Label them in your prompt as untrusted data, not instructions.
  • Keep the model that reads them separate from the one that acts, and pass along only what the reading step produced.
  • Do not let a result determine which tool runs or which URL gets called.
If you only display results or use them in your own code, treat them like any other untrusted input and escape them where they are rendered.

Make a search request

Send a POST request to /v1/search. Authenticate with your API key in the standard Authorization Bearer header, the same header every /v1 endpoint uses.

Request body

queries is the only required field. Pass one query for a simple lookup, or several when you want broader coverage of a topic. mode trades quality for speed. advanced is the default and returns higher quality results. turbo returns results faster.

Response

A successful search returns 200 with a JSON object.
  • search_id is a string that identifies this search.
  • results is an array. Each entry has:
    • url: the source URL.
    • title: the page title.
    • published: the publish date when available. It may be null.
    • excerpts: an array of relevant text snippets from the page.

Errors

A 503 with a Retry-After header is temporary: read the value, wait, and send the request again. A 503 whose error code is search_not_configured is not: retrying will not help. Contact us if you expected web search to be available.

Billing

Each successful search is billed to your organization per request: Failed searches are not billed.