Nukez Storage API

The Storage API from Nukez — 12 operation(s) for storage.

GitHub OpenAPI

Operations 13

POST /v1/storage/attest Storage Attest #
GET /v1/storage/verify Verify Locker Get #
POST /v1/storage/verify Verify Locker Post #
POST /v1/storage/provision Storage Provision #
POST /v1/storage/signed_provision Signed Storage Provision #
POST /v1/storage/refresh Storage Refresh #
GET /v1/storage/metadata/{locker_id} Storage Metadata #
POST /v1/storage/request Storage Request #
POST /v1/storage/confirm Storage Confirm #
GET /v1/storage/merkle-proof Merkle Proof #
GET /v1/storage/recompute-verify Recompute Verify #
GET /v1/storage/verification-bundle Verification Bundle #
GET /v1/storage/evidence-bundle Evidence Bundle #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nukez-xyz:nukez-xyz-storage-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nukez-xyz-storage-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nukez — Permissionless for Autonomous Agents Storage API
  version: 1.0.0
tags:
- name: Storage
paths:
  /v1/storage/attest:
    post:
      summary: Storage Attest
      description: 'Compute content attestation.


        AUTH: Requires a payer-signed envelope (X-Nukez-Envelope + X-Nukez-Signature)

        with the `locker:attest` operation. The envelope''s receipt_id must match the

        query-param receipt_id (belt-and-suspenders binding). Attestation computes

        the locker''s merkle fingerprint over confirmed files and persists it; when

        SB_AUTO_PUSH=true the gateway also pushes the att_code on-chain via

        Switchboard (server-held SOL), so this endpoint must be authenticated to

        the receipt''s payer.


        §11.1 — single push path:

        Default (sync=false): returns 202; the Cloud Tasks worker computes and

        pushes. Poll /v1/storage/verify for the result.

        sync=true: enqueues exactly like the async path, then polls the persisted

        attestation server-side and returns the terminal state in the legacy

        blocking-response shape. The push itself still happens in the worker —

        there is no in-request push. If the poll ceiling (ATTEST_SYNC_TIMEOUT_S,

        default 90 seconds) expires first, returns 202 with the verify URL.

        Dev (USE_CLOUD_TASKS not "true"): both forms fall back to the inline

        blocking path, since no queue exists; responses carry a "mode" marker.


        IMPORTANT: ?sync=true MUST be preserved. PTK tests, store_source.py, and

        manual debugging depend on it. Do not remove the sync path.


        Query params:

        receipt_id: The receipt ID bound to the locker

        sync: If true, block until the attestation reaches a terminal state'
      operationId: storage_attest_v1_storage_attest_post
      parameters:
      - name: receipt_id
        in: query
        required: true
        schema:
          type: string
          title: Receipt Id
      - name: sync
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Sync
      - name: X-Nukez-Envelope
        in: header
        required: true
        schema:
          type: string
          title: X-Nukez-Envelope
      - name: X-Nukez-Signature
        in: header
        required: true
        schema:
          type: string
          title: X-Nukez-Signature
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/verify:
    get:
      summary: Verify Locker Get
      description: 'Unified verification: returns payment proof + content proof together.


        This is the endpoint that powers the green checkmark on nukez.xyz/verify/{id}.

        It does NOT compute attestations — call POST /v1/storage/attest first,

        which requires a payer-signed envelope with the locker:attest operation.


        Response includes:

        - receipt: the payment proof (always present if receipt exists)

        - attestation: the content proof (null if not yet computed)

        - attestation_hint: how to compute attestation (if null)

        - verified: true if a completed (non-pending) attestation exists

        - verify_url: public verification URL'
      operationId: verify_locker_get_v1_storage_verify_get
      parameters:
      - name: receipt_id
        in: query
        required: true
        schema:
          type: string
          title: Receipt Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
    post:
      summary: Verify Locker Post
      description: 'Backward-compatible POST version of verify.


        Accepts { "receipt_id": "..." } in body.

        Returns same unified response as GET /v1/storage/verify.'
      operationId: verify_locker_post_v1_storage_verify_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              title: Payload
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/provision:
    post:
      summary: Storage Provision
      description: 'Provision a storage locker for a previously confirmed receipt_id.


        IMPORTANT (security):

        - In production (Cloud Run), this endpoint requires a payer-signed envelope.

        - For local dev ONLY, you may enable public provisioning by setting:

        NUKEZ_ALLOW_PUBLIC_PROVISION=1

        (and only when not running on Cloud Run).'
      operationId: storage_provision_v1_storage_provision_post
      parameters:
      - name: X-Nukez-Envelope
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Nukez-Envelope
      - name: X-Nukez-Signature
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Nukez-Signature
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvisionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/signed_provision:
    post:
      summary: Signed Storage Provision
      operationId: signed_storage_provision_v1_storage_signed_provision_post
      parameters:
      - name: X-Nukez-Envelope
        in: header
        required: true
        schema:
          type: string
          title: X-Nukez-Envelope
      - name: X-Nukez-Signature
        in: header
        required: true
        schema:
          type: string
          title: X-Nukez-Signature
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProvisionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/refresh:
    post:
      summary: Storage Refresh
      description: 'Refresh locker info — returns locker record with file_api hints.


        Requires signed envelope with locker:refresh operation.'
      operationId: storage_refresh_v1_storage_refresh_post
      parameters:
      - name: X-Nukez-Envelope
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Nukez-Envelope
      - name: X-Nukez-Signature
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Nukez-Signature
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefreshRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/metadata/{locker_id}:
    get:
      summary: Storage Metadata
      description: Return locker metadata. Requires signed envelope with locker:read.
      operationId: storage_metadata_v1_storage_metadata__locker_id__get
      parameters:
      - name: locker_id
        in: path
        required: true
        schema:
          type: string
          title: Locker Id
      - name: X-Nukez-Envelope
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Nukez-Envelope
      - name: X-Nukez-Signature
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Nukez-Signature
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/request:
    post:
      summary: Storage Request
      description: 'Start an x402 payment flow for provisioning storage data locker.


        Multi-chain support (CAIP-2 network identifiers):

        - Solana (default): omit pay_network/pay_asset or set pay_network="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"

        - EVM/Monad: set pay_network="eip155:10143", pay_asset="USDC" (or MON)

        - Legacy friendly names ("solana-devnet", "monad-testnet") still accepted on input


        - Supports request idempotency via Idempotency-Key header

        - Persists the *price-quote* on the pay request so /confirm uses the same terms

        - Provider-aware pricing: MongoDB is cheaper than GCS for structured data

        - Includes terms for transparent garbage collection / TTL


        1) Read {"units": N, "provider": "...", "pay_network": "...", "pay_asset": "..."} from JSON body

        2) Compute total_usd = unit_price_usd * units (provider-specific)

        3) Compute chain-specific payment amount (SOL lamports or EVM token units)

        4) Create pay_req_id and stash {units, quote} (quote carries terms_hash)

        5) Return x402 payment challenge with quote details and terms'
      operationId: storage_request_v1_storage_request_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Storage
  /v1/storage/confirm:
    post:
      summary: Storage Confirm
      description: 'Confirm an x402 payment (multi-chain: Solana + EVM/Monad)


        1) Read {"pay_req_id": "..."} from the JSON body.

        2) Read signature/tx_hash from X402-TX header.

        3) Look up pending = get_pending(pay_req_id)

        4) Check quote expiry (410 Gone if expired)

        5) Determine payment chain: payment_chain/pay_network from the body if

        given, else the pending quote''s network field

        6) Dispatch to chain-specific verifier:

        - Solana SOL: verify_sol_payment(sig, min_sol)

        - Solana SPL: verify_sol_spl_payment(sig, mint, treasury_ata, expected_raw)

        - EVM: verify_evm_payment(tx_hash, amount, asset, network, treasury)

        7) save_receipt(...) -> receipt_id.

        8) mark_paid(pay_req_id, receipt_id)

        9) return {"ok": True, "receipt_id": receipt_id}


        Idempotency behavior:

        - If the pay request is already confirmed, returns the existing receipt.

        - Receipt IDs are deterministic for a given (pay_req_id, tx_sig).

        Transaction signature sources (in priority order):

        1. X402-TX header (canonical, spec-compliant)

        2. tx_sig field in JSON body (fallback for constrained HTTP clients)'
      operationId: storage_confirm_v1_storage_confirm_post
      parameters:
      - name: X402-TX
        in: header
        required: false
        schema:
          type: string
          title: X402-Tx
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              title: Body
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/merkle-proof:
    get:
      summary: Merkle Proof
      description: 'Get a merkle inclusion proof for a single file in an attested locker.


        The proof consists of sibling hashes from the target leaf to the root.

        A verifier can walk the proof to reconstruct the merkle root and confirm

        it matches the on-chain attested root.


        Proof verification algorithm:

        1. Compute leaf_hash = SHA256("{filename}:{size_bytes}:{content_hash}")

        2. Walk the proof path:

        - If sibling.position == "right": current = SHA256(current + sibling.hash)

        - If sibling.position == "left": current = SHA256(sibling.hash + current)

        3. Final current must equal merkle_root


        Query params:

        receipt_id: Receipt ID for the locker

        filename: Name of the file to prove inclusion for


        Returns:

        JSON with proof path, leaf details, tree metadata, and verification data'
      operationId: merkle_proof_v1_storage_merkle_proof_get
      parameters:
      - name: receipt_id
        in: query
        required: true
        schema:
          type: string
          description: Receipt ID for the locker
          title: Receipt Id
        description: Receipt ID for the locker
      - name: filename
        in: query
        required: true
        schema:
          type: string
          description: Filename to get proof for
          title: Filename
        description: Filename to get proof for
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/recompute-verify:
    get:
      summary: Recompute Verify
      description: 'Trust Boundary 5 — Independent Attestation Recompute.


        Recomputes the merkle root from current locker contents (bypass cache)

        and compares against the persisted attestation object. The recompute is

        read-only: it happens entirely in memory and never overwrites the

        stored attestation.


        AUTH: Requires a payer-signed envelope (X-Nukez-Envelope +

        X-Nukez-Signature) with the `locker:read` operation, the same operation

        the locker read endpoints use. The envelope must bind this GET request

        (method, path, the receipt_id query string, and the empty-body hash),

        and its receipt_id must match the query-param receipt_id

        (belt-and-suspenders binding). This gate exists because the endpoint

        causes the backend to re-download file bytes from storage, and byte

        retrieval must originate only from an event authenticated by the payer

        keypair.


        Returns:

        200: { match: bool, computed: "sha256:...", stored: "sha256:...", ... }

        400: Missing receipt_id

        404: Receipt not found

        409: Locker not ready (no files or no attestation to compare against)'
      operationId: recompute_verify_v1_storage_recompute_verify_get
      parameters:
      - name: receipt_id
        in: query
        required: true
        schema:
          type: string
          title: Receipt Id
      - name: X-Nukez-Envelope
        in: header
        required: true
        schema:
          type: string
          title: X-Nukez-Envelope
      - name: X-Nukez-Signature
        in: header
        required: true
        schema:
          type: string
          title: X-Nukez-Signature
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/verification-bundle:
    get:
      summary: Verification Bundle
      description: 'Self-contained verification bundle for a receipt.


        Returns everything needed to independently verify data integrity:

        - Payment proof with Solana explorer link

        - Content proof (merkle root, file manifest with download URLs)

        - On-chain anchor (Switchboard tx/feed with explorer links)

        - Merkle algorithm specification (formal, machine-readable)

        - DIY verification steps and endpoint links


        No auth required — verification is permissionless.'
      operationId: verification_bundle_v1_storage_verification_bundle_get
      parameters:
      - name: receipt_id
        in: query
        required: true
        schema:
          type: string
          title: Receipt Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
  /v1/storage/evidence-bundle:
    get:
      summary: Evidence Bundle
      operationId: evidence_bundle_v1_storage_evidence_bundle_get
      parameters:
      - name: receipt_id
        in: query
        required: true
        schema:
          type: string
          title: Receipt Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Storage
components:
  schemas:
    RefreshRequest:
      properties:
        locker_id:
          type: string
          minLength: 1
          title: Locker Id
      type: object
      required:
      - locker_id
      title: RefreshRequest
    ProvisionRequest:
      properties:
        receipt_id:
          type: string
          minLength: 1
          title: Receipt Id
        tags:
          items:
            type: string
          type: array
          title: Tags
        operator_pubkey:
          anyOf:
          - type: string
          - type: 'null'
          title: Operator Pubkey
      type: object
      required:
      - receipt_id
      title: ProvisionRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError