Developers
Build on Headknot
The same cited answers you get in the app, from your own scripts, tools and AI assistants. Every answer points back to the documents it came from.
What you can use
The REST API at https://api.headknot.com/api/v1: list your workspaces, search them, ask questions and get answers with numbered citations, read documents, and add files or notes. API reference
The MCP server at https://api.headknot.com/api/mcp: add Headknot to Claude, ChatGPT, VS Code, Cursor, Gemini CLI or any MCP client. Set up an assistant
Both are on every plan, Free included.
Quick start
1. Create a key in the app under Settings → API keys. It is shown once: keep it somewhere safe.
2. List the workspaces it can use:
curl https://api.headknot.com/api/v1/workspaces \ -H "Authorization: Bearer $HEADKNOT_API_KEY"
3. Ask one of them a question:
curl -X POST https://api.headknot.com/api/v1/workspaces/$WORKSPACE_ID/ask \
-H "Authorization: Bearer $HEADKNOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question": "What did we decide about pricing?"}'The answer's [1], [2] markers refer to its citations: the document, a link to the original and the words relied on. Quote answers with their sources.
Authentication
Send Authorization: Bearer <key> on every request. A key acts as you, narrowed to the scopes and workspaces you gave it, and stops working the moment you revoke it. Production keys start with hk_live_.
AI assistants sign in instead of using a key: the first time, they send you to Headknot to sign in and approve their access. See MCP & assistants.
The API never accepts the app's sign-in cookie, and the app never accepts a key: they are separate on purpose.
Scopes
| Scope | Lets a key |
|---|---|
read | List workspaces, search, list and read documents. |
ask | Ask questions. |
write | Upload files and add notes. Off unless you turn it on. |
A key can do at most what you can: a workspace you cannot read is refused whatever its scopes.
Rate limits
| What | Per minute |
|---|---|
| Questions, per key | 30 |
| Uploads and notes, per key | 30 |
| Everything else, per key | 120 |
| All your keys, assistants and the app together | 600 |
Over a limit, the answer is 429 with a Retry-After header in seconds.
Errors
Errors are JSON with a status, a message you can show, and, where it helps, a code.
| Status | Code | Means |
|---|---|---|
| 401 | No credential, or one that is unknown, expired or revoked. | |
| 402 | QUOTA_EXCEEDED | This month’s AI Reasoning questions are used up. |
| 402 | PAYMENT_REQUIRED | A payment has not gone through; AI Reasoning is paused. |
| 403 | SCOPE_MISSING | The key lacks the scope this call needs (named in the response). |
| 403 | NOT_PERMITTED | You cannot use that workspace, or the key is limited to others. |
| 404 | Not found, or not something you can see. | |
| 429 | RATE_LIMITED | Too many calls; wait for Retry-After. |
What it costs
Exactly what the same thing costs in the app, and nothing else:
- An AI Reasoning answer counts as one of your monthly AI Reasoning questions. An answer that declines (the workspace does not hold enough) does not.
- Search, and asking in search mode, are free.
- Files and notes count toward your monthly ingestion, as uploads in the app do.
- Listing, reading and calling the API itself are free.