kbDrop

Developer quickstart

Stream cited answers from one knowledge base.

Send a question to a kbDrop knowledge base with a scoped API key and stream status, citations, answer text, completion, and errors over server-sent events.

Setup

Three things before the first request

  1. Prepare a knowledge base

    Add files, a ZIP, or a website and wait until its status is ready.

  2. Create a scoped key

    Open the knowledge base's API panel and create a key. Copy it immediately; the complete secret is shown only once.

  3. Read the event stream

    Send the key as a Bearer token and handle each SSE event until a done or error event ends the stream.

Request

POST a question

The key and the knowledge-base ID in the URL must belong to the same knowledge base. If they don't match, the API returns a plain not-found response.

curl --no-buffer --request POST \
  --url 'https://kbdrop.io/v1/knowledge-bases/<knowledge-base-id>/messages' \
  --header 'Authorization: Bearer kb_live_...' \
  --header 'Accept: text/event-stream' \
  --header 'Content-Type: application/json' \
  --data '{"input":"How do I reset the device?","stream":true}'

Response

Read named SSE events

A stream can emit status, citation, text_delta, done, or error. Switch on the event name and parse each data line as JSON.

event: status
data: {"phase":"retrieving"}

event: citation
data: {"citation":{"id":"source-1","label":"Reset guide"}}

event: text_delta
data: {"delta":"Hold the reset button for ten seconds [source-1]."}

event: done
data: {"conversationId":"...","messageId":"..."}

Production notes

  • Keep API keys on your server; never ship them in browser code.
  • Honor Retry-After on rate-limited responses.
  • Store the returned conversation ID to continue a thread.
  • Rotate or revoke a key from the same knowledge-base API panel.
Review the security boundary