---
title: "Create Search"
method: POST
path: "/v1/search"
tags: ["search"]
---

# Create Search

`POST /v1/search`

Run a search against a configured search tool.

The tool is taken from ``search_tool_name``, which may be omitted when
exactly one tool is configured.

Authentication modes:
- Master key: the ``user`` field is required and may name any existing user.
- API key: usage and spend always bind to the key's own user. A ``user``
  field naming a different user is rejected with 403 (or ignored, when the
  key's own ``reject_user_mismatch`` is false, or the deployment-wide
  setting is disabled and the key does not override it); it is never billed
  to that user.

## Request body

- SearchRequest — A search request, following LiteLLM's ``/v1/search`` body.
  - `country` string, nullable — Two-letter ISO country code to localize results to
  - `max_results` integer, nullable — Maximum number of results to return
  - `max_tokens_per_page` integer, nullable — Approximate cap on the page content returned per result
  - `query` string, required — The search query
  - `search_domain_filter` string[], nullable — Restrict results to these domains; prefix a domain with '-' to exclude it instead
  - `search_tool_name` string, nullable — Configured search tool to run against. Optional when exactly one tool is configured, and ignored on POST /v1/search/{search_tool_name}.
  - `user` string, nullable — User ID for usage attribution

## Response `200`

Successful Response

- SearchResponse — A completed search.
  - `object` 'search'
  - `results` SearchResultItem[], required
    - `date` string, nullable
    - `snippet` string, nullable
    - `title` string, nullable
    - `url` string, required
  - `search_tool` string, required — The configured search tool that served the request

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mozilla-ai/apis/otari.md) · [All operations](https://skmtc.net/mozilla-ai/apis/otari/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mozilla-ai/otari/revisions/2ebadef75cc8/schema)
