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

ScopeLets a key
readList workspaces, search, list and read documents.
askAsk questions.
writeUpload 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

WhatPer minute
Questions, per key30
Uploads and notes, per key30
Everything else, per key120
All your keys, assistants and the app together600

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.

StatusCodeMeans
401No credential, or one that is unknown, expired or revoked.
402QUOTA_EXCEEDEDThis month’s AI Reasoning questions are used up.
402PAYMENT_REQUIREDA payment has not gone through; AI Reasoning is paused.
403SCOPE_MISSINGThe key lacks the scope this call needs (named in the response).
403NOT_PERMITTEDYou cannot use that workspace, or the key is limited to others.
404Not found, or not something you can see.
429RATE_LIMITEDToo 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.