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 mcp add --transport http handwren https://handwren-xkedfa.helm7.app/api/mcp \
--header "Authorization: Bearer hw_live_..."| Tool | Needs | What it does |
|---|---|---|
| request_secret | API key | Creates 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_request | API key | Status of a request you made: open, fulfilled, declined (with their reason), cancelled or expired. Once fulfilled with a policy, your grantToken works. |
| call_api | Grant token | Makes 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_grant | Grant token | The policy, calls left and expiry of a grant you hold, plus a plain-English summary. |
| share_grant | Grant token | Creates 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_grant | Grant token | Ends a grant you hold, and any grants shared from it. Do this when the job is done. |
| create_link | API key | For 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_grants | API key | Every grant on the account with status, calls used and what it allows. Tokens aren't shown again. |
| get_plan | Nothing | Handwren'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.
| Endpoint | Auth | Does |
|---|---|---|
| POST /api/v1/links | API key or none | Store a link encrypted by you, or (with a key) send { secret } and we encrypt it. |
| GET /api/v1/links | API key | Links you've made, with views left and status. |
| GET /api/v1/links/{id} | None | Whether a link is still there, views left, passphrase salt. Never the ciphertext. |
| POST /api/v1/links/{id}/reveal | None | Spend a view: send the access token derived from the key, get the ciphertext. |
| DELETE /api/v1/links/{id} | API key or none | Burn a link early, with its burn token or as its owner. |
| POST /api/v1/requests | API key | Ask a person for a secret. Returns their link and, with a policy, your grant token. |
| GET /api/v1/requests | API key | Your requests. |
| GET /api/v1/requests/{id} | API key | Poll one request: open, fulfilled, declined, cancelled or expired. |
| POST /api/v1/requests/{id}/link | API key | Get a new link for an open request; the old one stops working. |
| DELETE /api/v1/requests/{id} | API key | Withdraw an open request. |
| GET /api/v1/secrets | API key | Secrets in your vault (names and dates, not values). |
| POST /api/v1/secrets | API key | Add a secret to your vault. |
| POST /api/v1/secrets/{id}/reveal | API key | Read a vault secret, or fetch an end-to-end envelope. Logged. |
| DELETE /api/v1/secrets/{id} | API key | Delete a secret and revoke every grant made from it. |
| GET /api/v1/grants | API key | Your grants with status and calls used. |
| POST /api/v1/grants | API key | Make a grant from a vault secret. The token is shown once. |
| GET /api/v1/grants/{id} | API key | One grant and its recent calls. |
| DELETE /api/v1/grants/{id} | API key | Revoke a grant and everything shared from it. |
| GET /api/v1/grants/self | Grant token | What the grant you hold allows, and what's left. |
| DELETE /api/v1/grants/self | Grant token | Give your grant up when the job is done. |
| POST /api/v1/grants/share | Grant token | Hand a narrower grant to another agent. |
| POST /api/v1/proxy | Grant token | Make one HTTPS call with the secret added. You get the API's answer. |
| GET /api/v1/me | API key | Your plan, limits and usage this month. |
| GET /api/v1/activity | API key | Activity log. ?format=csv on Pro. |
| GET /api/v1/plans | None | Plans, prices and limits. |
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 }Links from your own code
To keep the end-to-end property, encrypt before you send: 32 random bytes as the key, HKDF-SHA256 (salt handwren/link/v1) to derive an AES-256-GCM key (info encrypt) and an access token (info access), then POST ciphertext, iv and access token. The link is https://handwren-xkedfa.helm7.app/s/<id>#<key>. Or send { "secret": "..." } with an API key and we'll encrypt it for you (mode server).
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.
// 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.