> ## Documentation Index
> Fetch the complete documentation index at: https://docs.waniwani.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search the knowledge base



## OpenAPI

````yaml /api-reference/openapi.json post /api/mcp/kb/search
openapi: 3.1.0
info:
  title: Waniwani API
  version: 1.0.0
  description: >-
    The HTTP routes the Waniwani SDK and chat widget call. Use them from any
    language. Server routes take a secret `wwk_` API key; chat routes take a
    channel's `wwp_` public key, which is meant to ship in a web page.
servers:
  - url: https://app.waniwani.ai
    description: US region
  - url: https://eu.app.waniwani.ai
    description: EU region
security: []
tags:
  - name: Server API
    description: Called from your server with a secret `wwk_` API key.
  - name: Chat API
    description: Called from a web page with a channel's `wwp_` public key.
paths:
  /api/mcp/kb/search:
    post:
      tags:
        - Server API
      summary: Search the knowledge base
      operationId: searchKb
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  format: uuid
                query:
                  type: string
                  minLength: 1
                  maxLength: 1000
                topK:
                  type: integer
                  minimum: 1
                  maximum: 20
                  default: 5
                minScore:
                  type: number
                  minimum: 0
                  maximum: 1
                  default: 0.3
                metadata:
                  type: object
                  additionalProperties:
                    type: string
                audience:
                  type: string
                  enum:
                    - draft
                    - live
              required:
                - query
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: string
                        heading:
                          type: string
                        content:
                          type: string
                        score:
                          type: number
                        metadata:
                          type: object
                          additionalProperties:
                            type: string
                      required:
                        - source
                        - heading
                        - content
                        - score
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - message
                  - data
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: WaniWaniApiKey
      description: 'Waniwani API key passed as `Authorization: Bearer wwk_<key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.