---
title: "Retrieve From Kb"
method: POST
path: "/api/knowledge-bases/{kb_id}/retrieve"
tags: ["knowledge-bases"]
---

# Retrieve From Kb

`POST /api/knowledge-bases/{kb_id}/retrieve`

## Path parameters

- `kb_id` string, required

## Request body

- KBRetrieveRequest
  - `query` string, required
  - `top_k` integer

## Response `200`

Successful Response

- ApiResponse
  - `success` boolean
  - `data` unknown
  - `error` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-03-22** `6dc2d6f33d44` — 2 breaking, 9 info
  - the `query` request property's minLength was increased from `0` to `1`
  - the `data` response's property type/format changed from `array`/`` to ``/`` for status `200`
  - api operation id `retrieve_from_kb_api_knowledge_bases__kb_id__retrieve_post` was added
  - the endpoint scheme security `HTTPBearer` was added to the API
  - …7 more

[Change history](https://skmtc.dev/fim-ai/apis/fim-one-api/changes/api/knowledge-bases/:kb_id/retrieve/post.md)

---

[API](https://skmtc.dev/fim-ai/apis/fim-one-api.md) · [All operations](https://skmtc.dev/fim-ai/apis/fim-one-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fim-ai/fim-one-api/revisions/89738ff55831/schema)
