Appearance
Knowledge API
The Lab0 Knowledge API stores documents and answers questions grounded in them. Upload a file, wait for it to be ready, then ask a question. Every request sees only the files belonging to the user who created the API key.
Choose your language
Each walkthrough runs the complete upload → ready → answer journey and prints the answer with its source files.
| Language | What you need |
|---|---|
| curl | Bash, curl and jq |
| Python | Python 3.10+ and requests |
| Node.js | Node.js 22+; no packages |
| Go | Go 1.22+; standard library only |
How it works
- Create a key. Open Account → API keys in the Lab0 console and create a key with Read & write access. See authentication.
- Upload into a namespace. Use a name such as
quickstartto group your documents. Lab0 creates the namespace on the first upload. - Wait for
ready. Uploads return immediately. Poll the file until processing finishes; stop and inspecterrorif it fails. - Ask a question. Send a prompt and namespace. Use
file_idsto restrict it to particular files. The response containsanswer,sourcesandmodel.
The production base URL is https://app.lab0.ai/app. Every API path starts with /api/knowledge.
Try a small document
Save this as plan.md, or download it. The walkthroughs use this exact file.
md
# Plan
The rollout uses quillfeather checklists.Ask “How is the rollout run?”. The document says that it uses quillfeather checklists; the returned sources should identify plan.md. The examples use file_ids so other files in your namespace do not affect the question.
Find the details
- Documents & namespaces: processing, file ownership, formats and cleanup.
- Streaming answers: events, resets and incomplete answers.
- API reference: every endpoint, schema, limit and error code.
- OpenAPI document: the same specification served by the backend, copied unchanged at build time.