Skip to content
Handwren

Developers

API and MCP

Everything the website does, an agent can do. Free on every plan: get a key from Settings and send it as Authorization: Bearer hw_live_...

Machine-readable: /openapi.json, /llms.txt, /api/v1/plans.

MCP server

Streamable HTTP at https://handwren-xkedfa.helm7.app/api/mcp, stateless, JSON responses. Discovery needs no key. Tools that act on an account need an API key; tools that use a grant take the grant token as an argument, so an agent with no account can use a grant it was handed.

Claude Code
claude mcp add --transport http handwren https://handwren-xkedfa.helm7.app/api/mcp \
  --header "Authorization: Bearer hw_live_..."
ToolNeedsWhat it does
request_secretAPI keyCreates a link you give to a person (in chat, or we email it on Pro). They see who is asking, why, and exactly what you'll be allowed to do, then paste the secret in. With a policy (service or hosts), you get a grantToken now that starts working once they approve: use it with call_api and you never see the secret. Without a policy, the secret goes to the account's vault for the human owner. Poll get_request for the answer.
get_requestAPI keyStatus of a request you made: open, fulfilled, declined (with their reason), cancelled or expired. Once fulfilled with a policy, your grantToken works.
call_apiGrant tokenMakes one HTTPS request with the secret behind a grant. Handwren adds the credential where the approved policy says and returns the API's status, headers and body. You never see the secret, and it's redacted if the API echoes it. Refused if the host, method or path isn't allowed, or the grant is revoked, expired or used up.
check_grantGrant tokenThe policy, calls left and expiry of a grant you hold, plus a plain-English summary.
share_grantGrant tokenCreates a child grant from one you hold, for another agent (which needs no Handwren account). It can't allow more than yours: same or fewer hosts, methods and paths, no more calls than you have left, no later expiry. Revoking yours ends it too.
revoke_grantGrant tokenEnds a grant you hold, and any grants shared from it. Do this when the job is done.
create_linkAPI keyFor a secret you already hold (say, a password you just generated for someone). Returns a link that burns after the views or time you set. Encrypted on Handwren's server, since you've handed it the plaintext; a person using the website gets browser-side encryption instead.
list_grantsAPI keyEvery grant on the account with status, calls used and what it allows. Tokens aren't shown again.
get_planNothingHandwren's plans and prices. With a key, also this account's plan and what it has used this month.

REST API

JSON in, JSON out. Every error has an error sentence and a stable code. Grant endpoints take Handwren-Grant: hwg_... instead of an API key.

EndpointAuthDoes
POST /api/v1/linksAPI key or noneStore a link encrypted by you, or (with a key) send { secret } and we encrypt it.
GET /api/v1/linksAPI keyLinks you've made, with views left and status.
GET /api/v1/links/{id}NoneWhether a link is still there, views left, passphrase salt. Never the ciphertext.
POST /api/v1/links/{id}/revealNoneSpend a view: send the access token derived from the key, get the ciphertext.
DELETE /api/v1/links/{id}API key or noneBurn a link early, with its burn token or as its owner.
POST /api/v1/requestsAPI keyAsk a person for a secret. Returns their link and, with a policy, your grant token.
GET /api/v1/requestsAPI keyYour requests.
GET /api/v1/requests/{id}API keyPoll one request: open, fulfilled, declined, cancelled or expired.
POST /api/v1/requests/{id}/linkAPI keyGet a new link for an open request; the old one stops working.
DELETE /api/v1/requests/{id}API keyWithdraw an open request.
GET /api/v1/secretsAPI keySecrets in your vault (names and dates, not values).
POST /api/v1/secretsAPI keyAdd a secret to your vault.
POST /api/v1/secrets/{id}/revealAPI keyRead a vault secret, or fetch an end-to-end envelope. Logged.
DELETE /api/v1/secrets/{id}API keyDelete a secret and revoke every grant made from it.
GET /api/v1/grantsAPI keyYour grants with status and calls used.
POST /api/v1/grantsAPI keyMake a grant from a vault secret. The token is shown once.
GET /api/v1/grants/{id}API keyOne grant and its recent calls.
DELETE /api/v1/grants/{id}API keyRevoke a grant and everything shared from it.
GET /api/v1/grants/selfGrant tokenWhat the grant you hold allows, and what's left.
DELETE /api/v1/grants/selfGrant tokenGive your grant up when the job is done.
POST /api/v1/grants/shareGrant tokenHand a narrower grant to another agent.
POST /api/v1/proxyGrant tokenMake one HTTPS call with the secret added. You get the API's answer.
GET /api/v1/meAPI keyYour plan, limits and usage this month.
GET /api/v1/activityAPI keyActivity log. ?format=csv on Pro.
GET /api/v1/plansNonePlans, prices and limits.
Ask a person for a Stripe key, then use it
curl -X POST https://handwren-xkedfa.helm7.app/api/v1/requests \
  -H "Authorization: Bearer hw_live_..." -H "content-type: application/json" \
  -d '{"title":"Stripe restricted key","purpose":"Reconcile October refunds",
       "policy":{"service":"stripe","paths":["/v1/refunds"]},"grantMaxCalls":200}'
# → { "url": "https://handwren-xkedfa.helm7.app/r/hwr_...", "grantToken": "hwg_...", "request": { "id": "...", "status": "open" } }

curl https://handwren-xkedfa.helm7.app/api/v1/requests/<id> -H "Authorization: Bearer hw_live_..."
# → { "request": { "status": "fulfilled", ... } }

curl -X POST https://handwren-xkedfa.helm7.app/api/v1/proxy \
  -H "Handwren-Grant: hwg_..." -H "content-type: application/json" \
  -d '{"method":"GET","url":"https://api.stripe.com/v1/refunds?limit=10"}'
# → { "status": 200, "headers": {...}, "body": "{...}", "callsLeft": 199 }

End-to-end requests

Put your own P-256 public key on a request and the person's browser encrypts the secret to it. We store an envelope we can't open; fetch it with POST /api/v1/secrets/<id>/reveal and open it locally. Plain WebCrypto, no SDK.

Opening an envelope (any WebCrypto runtime: Node 20+, Deno, Bun, browsers)
// The person's browser does this; your agent only needs the open() half.
// ECDH P-256 with a fresh ephemeral key, HKDF-SHA256, AES-256-GCM.
// HKDF salt = utf8(epk.x + "." + yourPublicKey.x), info = utf8("handwren/envelope/v1")

const { publicKey, privateKey } = await crypto.subtle.generateKey(
  { name: "ECDH", namedCurve: "P-256" }, true, ["deriveBits"]);
const pub = await crypto.subtle.exportKey("jwk", publicKey);
// POST /api/v1/requests { title, publicKey: { kty, crv, x, y } }

async function open(env, privateKey, myX) {
  const epk = await crypto.subtle.importKey("jwk", env.epk,
    { name: "ECDH", namedCurve: "P-256" }, false, []);
  const bits = await crypto.subtle.deriveBits({ name: "ECDH", public: epk }, privateKey, 256);
  const hk = await crypto.subtle.importKey("raw", bits, "HKDF", false, ["deriveKey"]);
  const enc = new TextEncoder();
  const key = await crypto.subtle.deriveKey(
    { name: "HKDF", hash: "SHA-256", salt: enc.encode(env.epk.x + "." + myX),
      info: enc.encode("handwren/envelope/v1") },
    hk, { name: "AES-GCM", length: 256 }, false, ["decrypt"]);
  const b64 = (s) => Uint8Array.from(atob(s.replace(/-/g, "+").replace(/_/g, "/")), (c) => c.charCodeAt(0));
  return new TextDecoder().decode(await crypto.subtle.decrypt(
    { name: "AES-GCM", iv: b64(env.iv) }, key, b64(env.ct)));
}

Errors, limits and rate limits

400 invalid_inputA field is missing or wrong; the error names it.

400 invalid_policyA host, method, path or auth header isn't allowed.

401 unauthorizedMissing or unknown API key or grant token.

402 limit_reachedYour plan's limit; `limit` says which.

403 host_not_allowedThe grant doesn't cover that host (also method_ and path_not_allowed).

403 revokedThe grant was revoked (also expired, used_up).

403 private_addressThe host resolves to a private network.

410 goneThe link burnt or expired.

429 rate_limitedSlow down; try again in a minute.

502 upstream_unreachableThe API couldn't be reached (504 upstream_timeout after 20s).

Limits come from your plan: Free allows 200 brokered calls a month and 2 active grants; Pro allows 10,000. Rate limits are per IP (links, answers) or per grant (120 calls a minute). See pricing.