Clankr

API

The HTTP API is the product. The website, curl, and every coding-CLI hook call the same endpoint. There is no API key.

The only operation

POST /api/shorten
Content-Type: application/json

{
  "text": "Verbose AI output…",
  "mode": "standard",
  "compression": 72,
  "source_model": "grok"
}

Every successful request creates a retained contribution. The response returns a contribution identifier and a deletion token. Keep the token private; it is required to save feedback or delete the contribution. Machine-readable contract: openapi.yaml.

How other people contribute from their own models

Every successful shorten is stored in the production corpus on this site — the encrypted database on Clankr-controlled hardware at clankr.chat. That corpus is what trains the public Clankr model, including the engineering specialist. Contributors do not run a database, Ollama, or their own Clankr. Cloning the repo only installs a tiny client that POSTs to us.

Keep using Grok, Claude, Cursor, Codex, or a local model in your own CLI. Do not paste every reply, and do not tell the model “please post this to Clankr.” When a turn ends, the CLI fires a Stop / after-response hook. A local script reads the finished assistant text and sends it here:

POST https://clankr.chat/api/shorten

The on-screen frontier-model answer does not change. Clankr cannot rewrite another product’s chat bubble. The pair (your model’s verbose reply + Clankr’s rewrite) is encrypted and retained for training under the data policy. Engineering-shaped pastes are tagged automatically for the CAD/engineering pool; you do not choose the tag.

git clone https://github.com/jnadeau207-collab/clankr.git
cd clankr
node contrib/cli/install.mjs

That copies the submitter to ~/.clankr/clankr-submit.mjs (a client, not a server) and registers:

  • Grok — Stop hook at ~/.grok/hooks/clankr-stop.json. Reload with /hooks, then r.
  • Claude Code — Stop merged into ~/.claude/settings.json. Restart Claude Code.
  • Cursor — afterAgentResponse merged into ~/.cursor/hooks.json. Restart Cursor.

The hook detaches immediately so a 30–90 second job on this GPU never stalls the contributor’s CLI. Replies under 80 words, subagent turns, interrupted turns, and Grok’s 32k-clipped Stop payloads are skipped. Failures (timeout, 429, Clankr down) fail open. Public rate limit: 30 shortens per 10 minutes per client.

Default destination is https://clankr.chat. Leave CLANKR_URL unset unless you are deliberately pointing at a different origin. Do not point a Grok HTTP hook at this URL: HTTP hooks POST the vendor event envelope; this API requires {"text":"…"}. The local script is the translator. Full env vars, generic stdin for other CLIs, and feedback commands: contrib/README.md.

curl

curl -sS https://clankr.chat/api/shorten \
  -H "content-type: application/json" \
  -d '{"text":"Verbose AI output…","mode":"technical","compression":72,"source_model":"claude"}'

Feedback or correction

PATCH /api/contributions/{id}
{
  "token": "…",
  "feedback": "good",
  "correction": "Optional preferred version"
}

The CLI pack stores the last token in ~/.clankr/last.json so a contributor can run node ~/.clankr/clankr-submit.mjs --feedback good without scraping a response.

Delete

DELETE /api/contributions/{id}
{
  "token": "…"
}