---
title: "POST /fragments/searchByPrompt"
method: POST
path: "/fragments/searchByPrompt"
---

# POST /fragments/searchByPrompt

`POST /fragments/searchByPrompt`

Uses a prompt to find chunks of relevant text from a document specified by document ID

## Request body

- FragmentsSearchByPromptBody
  - `documentId` number, required
  - `content` string, required
  - `model` 'text-embedding-3-small' | 'text-embedding-3-large' | 'text-embedding-ada-002'
  - `matchCount` number
  - `matchThreshold` number

## Response `200`

Successful response

- object[]
  - `id` number, required
  - `content` string, required
  - `metadata` unknown
  - `documentId` number, required

## Other responses

- `401` — Invalid authentication credentials.
- `408` — The server timed out waiting for the request.
- `412` — Usage has exceeded the monthly limit.
- `500` — An unspecified error occurred.

---

[API](https://skmtc.dev/blocks/apis/looking-glass-api.md) · [All operations](https://skmtc.dev/blocks/apis/looking-glass-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/blocks/looking-glass-api/revisions/c79a9a0e44b0/schema)
