ncrypted / guides

HTTP API and x402

Call ncrypted directly from any language.

Encrypt client-side (AES-256-GCM, key = HKDF-SHA256 of a random 32-byte link key; see the reference implementation), then POST the ciphertext. Without a payment header you get the free tier while it lasts; after that the response is an x402 402 with payment requirements for 0.005 USDC on Base.

POST /api/v1/secrets            {v:1, ciphertext, iv, salt, hasPassphrase, ttl?} -> {id, url, expiresAt, receiptToken}
POST /api/v1/secrets/{id}/reveal                                              -> payload (deleted atomically)
GET  /api/v1/quota                                                            -> {freeRemaining, price, ...}
POST /api/v1/requests            {publicKey, label, ttl?}                     -> {id, url, pollToken}
POST /api/v1/requests/{id}/collect   Bearer pollToken                         -> 202 | {sealed}

Full reference: /openapi.json and /llms.txt. Reference crypto: github.com/Seidl-Family/ncrypted/blob/main/packages/sdk/src/crypto.ts