Nukez

Docs · HTTP

HTTP API

any language

Reference

Endpoint reference

Gateway Reference

Authenticated locker and file endpoints carry two headers: X-Nukez-Envelope and X-Nukez-Signature. The envelope binds method, path, body_sha256, receipt_id, locker_id, nonce, iat/exp, and the required ops array. POST bodies hash the exact bytes sent; authenticated GETs sign body_sha256 of empty bytes. See /docs/http/helpers for portable signers.

Discovery

MethodPathAuthDescription
GET/.well-known/nukez.jsonnoneService capabilities, supported networks, signed-envelope ops by endpoint, and real-world failure-mode hints.

Storage payment (x402 v2)

MethodPathAuthDescription
POST/v1/storage/requestnoneReturns HTTP 402 with x402 v2 accepts[] (8 legs at present: Solana SOL/USDC/USDT/WETH and Monad USDC/USDT0/MON/WETH). Quote TTL is 300s.
POST/v1/storage/confirmX402-TXBody carries pay_req_id, pay_network, and pay_asset for the SELECTED accepts[] leg. X402-TX header carries the on-chain tx signature. Returns receipt + receipt_id.

Locker provisioning + record

MethodPathAuthDescription
POST/v1/storage/signed_provisionX-Nukez-Envelope · locker:provisionProvisions the locker bound to the receipt. locker_id is deterministic — sha256(receipt_id).hex()[:12].
GET/v1/lockers/{locker_id}/recordX-Nukez-Envelope · locker:readCold-path locker ownership document (locker_record_v4) — owner_id, operator_ids, provider, bucket, path_prefix.
GET/v1/storage/metadata/{locker_id}X-Nukez-Envelope · locker:readLocker metadata (locker_metadata_v1) including paid_amount, paid_raw, pay_asset, tx_hash, units, unit_price_usd. result_hash populates after attest.
POST/v1/storage/refreshX-Nukez-Envelope · locker:refreshRefreshes the locker manifest with a fresh ts and returns the file_api block.

Files

MethodPathAuthDescription
POST/v1/lockers/{locker_id}/filesX-Nukez-Envelope · locker:writeCreate a file entry. Returns upload_url, download_url, confirm_url. urls_expire_in_sec is 1800.
POST/v1/lockers/{locker_id}/files/batchX-Nukez-Envelope · locker:writeCreate entries for multiple files in one signed envelope. Returns per-file upload_url + a single confirm_batch_url.
GET/v1/lockers/{locker_id}/filesX-Nukez-Envelope · locker:listList files in the locker. Authenticated GETs still sign body_sha256 of empty bytes.
GET/v1/lockers/{locker_id}/files/{filename}X-Nukez-Envelope · locker:readRe-mint upload_url + download_url for an existing file (?ttl_min=30 default).
DELETE/v1/lockers/{locker_id}/files/{filename}X-Nukez-Envelope · locker:writeTombstone the file in the manifest.
PUT{upload_url}URL tokenDirect PUT to the GCS signed URL from create_file. Anything potentially over 30 MB needs the resolve-redirect pattern (Cloud Run hard 32 MB body cap).
GET{download_url}URL tokenDirect GET from the GCS signed URL. Time-limited; for sharing prefer the receipt proxy below.
POST/v1/files/confirm?receipt_id={rid}&filename={f}URL tokenConfirm a single file upload. Records size_bytes + content_hash.
POST/v1/files/confirm-batchURL tokenConfirm a batch upload. Re-confirm individual files via /v1/files/confirm if a single member fails (UPLOAD_VERIFY_MISSING_AFTER_WRITE).
GET/v1/r/{receipt_id}/f/{filename}nonePublic, stable receipt-based file proxy. 307-redirects to a fresh signed storage URL on every request — never expires, no GCS bucket-path leakage.

Attestation + verification

MethodPathAuthDescription
POST/v1/storage/attest?receipt_id={rid}X-Nukez-Envelope · locker:attestSigned-envelope attestation: computes merkle root over confirmed files and pushes the att_code to a Switchboard PullFeed on Solana. Async/retryable: status "computed" → "complete" once the on-chain push confirms. The gateway also auto-attests after every successful file confirm via Cloud Tasks, so explicit calls here are only needed to force a fresh anchor immediately or to receive a synchronous result.
GET/v1/attest-code?receipt_id={rid}noneShort numeric att_code derived from result_hash, plus switchboard_slot/switchboard_tx for the latest anchor.
GET/v1/storage/merkle-proof?receipt_id={rid}&filename={f}nonePer-file Merkle inclusion proof: leaf_hash, proof[] (sibling+position), merkle_root, tree_depth, file_count, switchboard anchor.
POST/v1/storage/verifynonePublic verification snapshot. Body: {receipt_id}. On confirmed lockers the response carries the populated content_proof + on_chain_anchor (auto-reattest runs after every file confirm). Empty or pre-attest lockers return verified=false with an attestation_hint pointer.
GET/v1/storage/verification-bundle?receipt_id={rid}noneSelf-contained portable proof: payment_proof + content_proof (merkle_root, files) + on_chain_anchor + merkle_algorithm + verify_yourself + verify_page_url.
GET/specs/nukez-merkle-v1.jsonnoneMachine-readable canonical Merkle V1 specification for agents, auditors, SDKs, and external verifiers.
GET/v1/receipts/{rid}noneStored receipt object with receipt_hash and full payment metadata.
GET/v1/receipts/{rid}/verifynoneServer-recomputed receipt_hash for tamper-evidence cross-check.