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

# Search Endpoint

`POST /v1/search`

Semantic search within a knowledge base.

## Headers

- `authorization` string, nullable

## Request body

- SearchRequest — Schema for search request.
  - `query` string, required — Search query
  - `knowledge` union — Knowledge base slug(s) to search in. Can be a single slug, a list of slugs, or None to search all KBs.
    - string
    - string[]
  - `limit` integer — Maximum number of results
  - `mode` 'fast' | 'balanced' | 'deep' — Search mode

## Response `200`

Successful Response

- SearchResponse — Schema for search response.
  - `query` string, required — Original query
  - `knowledge` union — Knowledge base(s) searched. None means all KBs were searched.
    - string
    - string[]
  - `limit` integer, required — Result limit
  - `mode` string, required — Search mode used
  - `totalResults` integer, required — Total number of results
  - `results` SearchResult[], required — Search results
    - `id` string, required — Result ID
    - `chunk` string, required — The chunk text
    - `distance` number, required — Distance/similarity score
    - `metadata` SearchResultMetadata, required — Schema for search result metadata.
      - `source_file` string, required — The source file of the chunk
      - `chunk_index` integer, required — The index of the chunk
      - `knowledge_base` string, nullable — The knowledge base slug this result came from
      - `page` integer, nullable — The page of the chunk (for PDFs, DOCX, etc.)
      - `start_index` integer, nullable — The start index of the chunk
      - `end_index` integer, nullable — The end index of the chunk
      - `start_line` integer, nullable — The start line of the chunk
      - `end_line` integer, nullable — The end line of the chunk
  - `context` string — Combined context from results

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/chonkie/apis/chonkie-api.md) · [All operations](https://skmtc.dev/chonkie/apis/chonkie-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chonkie/apis/chonkie-api/revisions/f40f036f941c?raw)
