> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simpuru.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the content (x402 paywall)

> **Unpaid:** `402` with a base64 JSON `PAYMENT-REQUIRED` header listing up to two options:
- `default` (**instant**): pay `listing.sellerAddress` directly.
- `masumi` (**protected**): lock into our escrow under a seller-signed quote whose `input_hash` commits to
  `{ listingId, contentHash }`. Deadlines: refund ≥ ~16 min, seller paid ≥ ~31 min, arbiter ≥ ~46 min.

**Paid retry:** send the signed Cardano transaction in `PAYMENT-SIGNATURE` (an x402 client such as
`@x402/fetch` + `@x402/cardano` does this). The in-process facilitator verifies, the content is returned,
then the tx is broadcast; `PAYMENT-RESPONSE` carries the settlement (tx hash). Takes ~20-60 s.

**Returning buyer:** send `X-Simpuru-Proof` instead to get content already paid for, without paying again.



## OpenAPI

````yaml https://api.simpuru.xyz/openapi.json get /listings/{id}/unlock
openapi: 3.1.0
info:
  title: Simpuru API
  version: 0.1.0
  summary: Buyer protection for AI agents paying with x402 on Cardano (preprod).
  description: >-
    Sellers list design prompts; each listing commits to the SHA-256 of its
    content.

    Buyers (people or agents) pay over **x402** on Cardano preprod, either
    **instant** (pay the seller)

    or **protected** (lock into our `vested_pay` escrow, released only if
    delivery checks out).


    Consumers: the web app (`apps/web`), the buyer agent and protection watcher
    (`apps/agent`), the MCP

    server (`apps/mcp`, hosted at `/mcp`), and the arbiter service
    (`apps/arbiter`, internal).


    Every on-chain claim can be checked on
    `https://preprod.cardanoscan.io/transaction/<hash>`.
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://api.simpuru.xyz
    description: Production (Cardano preprod)
  - url: http://localhost:4021
    description: Local `bun run dev` in apps/api
security: []
tags:
  - name: Account
    description: >-
      Sign in with a Cardano wallet (CIP-30 `signData`), then use the session as
      `Authorization: Bearer <token>`. Every account has a Simpuru wallet: a
      preprod wallet the platform holds for the owner, funded with tADA, that
      web purchases and the owner's agents spend from.
  - name: Catalogue
    description: Free listing data.
  - name: Paid content
    description: 'The x402 paywall: instant or escrow-protected.'
  - name: Purchases
    description: Purchase timelines, derived from chain by the seller agent.
  - name: MCP
    description: Model Context Protocol endpoint for agents (Claude Code, Cursor, ...).
  - name: Arbiter (internal)
    description: Dispute settlement service, `apps/arbiter`, port 4023. Not public.
  - name: System
    description: Health.
paths:
  /listings/{id}/unlock:
    get:
      tags:
        - Paid content
      summary: Get the content (x402 paywall)
      description: >-
        **Unpaid:** `402` with a base64 JSON `PAYMENT-REQUIRED` header listing
        up to two options:

        - `default` (**instant**): pay `listing.sellerAddress` directly.

        - `masumi` (**protected**): lock into our escrow under a seller-signed
        quote whose `input_hash` commits to
          `{ listingId, contentHash }`. Deadlines: refund ≥ ~16 min, seller paid ≥ ~31 min, arbiter ≥ ~46 min.

        **Paid retry:** send the signed Cardano transaction in
        `PAYMENT-SIGNATURE` (an x402 client such as

        `@x402/fetch` + `@x402/cardano` does this). The in-process facilitator
        verifies, the content is returned,

        then the tx is broadcast; `PAYMENT-RESPONSE` carries the settlement (tx
        hash). Takes ~20-60 s.


        **Returning buyer:** send `X-Simpuru-Proof` instead to get content
        already paid for, without paying again.
      operationId: unlockListing
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Listing id
        - name: PAYMENT-SIGNATURE
          in: header
          required: false
          schema:
            type: string
          description: x402 payment payload (base64), on the paid retry.
        - name: X-Simpuru-Proof
          in: header
          required: false
          schema:
            type: string
            contentEncoding: base64
            contentMediaType: application/json
            contentSchema:
              $ref: '#/components/schemas/UnlockProof'
          description: >-
            Base64 JSON `UnlockProof` (see schema): proves the caller already
            paid.
      responses:
        '200':
          description: The content
          headers:
            PAYMENT-RESPONSE:
              schema:
                type: string
              description: >-
                Base64 JSON x402 settlement response (`transaction` = tx hash).
                Absent on a returning-buyer redelivery.
            X-Simpuru-Purchase:
              schema:
                type: string
                pattern: ^[0-9a-f]{64}$
                description: Cardano transaction hash.
              description: 'On a returning-buyer redelivery: the original purchase tx.'
          content:
            text/plain:
              schema:
                type: string
        '402':
          description: >-
            Payment required, or the payment was rejected (`error` in the header
            payload)
          headers:
            PAYMENT-REQUIRED:
              schema:
                type: string
              description: Base64 JSON x402 `PaymentRequired` with `accepts`.
        '404':
          description: Unknown listing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.