U.CASH Buy API

Fetch the 402 door, pay, and settle a payment (public)

GitHub OpenAPI

Operations 6

POST /v1/verify Optional instant settle (POST the on-chain tx hash). #
POST /v1/simulate-payment SANDBOX ONLY: advance a test-mode payment's simulated confirmations (no chain… #
GET /r/{id} The 402 door (back-compat alias of pay.u.cash /checkout/; same engine, same… #
POST /v1/exact-verify x402 facilitator verify: is this signed EIP-3009 USDC-on-Base payment… #
POST /v1/exact-settle x402 facilitator settle: verify the signed payment AND settle (relay by… #
GET /relayer/{id} Public: is this resource sponsored by a gasless relayer? #

Specifications

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/u-cash:u-cash-buy-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

u-cash-buy-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: agents.u.cash Buy API
  version: 0.7.3
  description: 'Agent + merchant product surface for the 402 Online Protocol - multi-coin, non-custodial HTTP-402 payments. Two-sided: sell (get paid to your own wallet) and buy (pay for resources). UCP (ucp.dev) discovery + multi-item mixed-currency checkout sessions + AP2 mandates + RFC 9421-signed responses. Live reference implementation; protocol spec at https://402.onl. INPUT CONTRACTS (all authenticated writes): unknown keys are rejected with 400 uxc_unknown_param listing the Allowed keys; wrong shapes are rejected with 400 uxc_invalid_request naming the field and expected shape; booleans must be true/false (or "true"/"false"); updates are true partials (unsent fields keep their values). Supported assets (grouped; the engine master list): Bitcoin (BTC, +Lightning), Ethereum (ETH), Solana (SOL), Tron (TRX), XRP, Dogecoin (DOGE), Litecoin (LTC), Bitcoin Cash (BCH), Algorand (ALGO), Monero (XMR), Polkadot (DOT), Stellar (XLM), Tezos (XTZ), Polygon (POL), Avalanche (AVAX), BNB Chain (BNB), Toncoin (TON); Base, Arbitrum, Optimism, Linea, Mantle, Berachain, Sonic, Unichain, World, Monad, Plasma, Abstract, Scroll, Ink, Hyperliquid (native gas + ETH-bridged), Robinhood Chain (native gas + ALL 194 issuer-listed tokenized-asset rails; featured set in pickers, u.cash/tokenized-assets for the full list), Arc (Circle L2, native USDC gas); USDT (Ethereum / BSC / Tron), USDC (Ethereum / native on Arc), and USDC-on-Base (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913) - the x402 gasless rail; UCASH (Ethereum ERC-20, 0x92e52a1A235d9A103D970901066CE910AAceFD37) - also the non-withdrawable fee-credit unit; Any ERC-20 / BEP-20 / Base-20 / Polygon-20 / Arb-20 / Op-20 / Avax-20 / Linea / Mantle / Sonic / Bera / ... / TRC-20 / SPL / TON Jetton / Robinhood-20 / Arc-20 added via POST /v1/custom-tokens (auto-detected on-chain like any coin)'
  contact:
    url: https://github.com/UdotCash/agents
servers:
- url: https://agents.u.cash
  description: agents.u.cash
tags:
- name: Buy
  description: Fetch the 402 door, pay, and settle a payment (public)
paths:
  /v1/verify:
    post:
      tags:
      - Buy
      summary: Optional instant settle (POST the on-chain tx hash).
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Verify'
      responses:
        '200':
          description: '{settled:true} | {status:pending, confirmations, required} | {status:underpaid}'
        '404':
          description: challenge not found
        '410':
          description: challenge expired
      operationId: postV1Verify
      x-operation-id-source: derived
  /v1/simulate-payment:
    post:
      tags:
      - Buy
      summary: 'SANDBOX ONLY: advance a test-mode payment''s simulated confirmations (no chain…'
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - challengeId
              properties:
                challengeId:
                  type: string
                confirmations:
                  type: integer
                  minimum: 1
                  maximum: 12
                  default: 1
      responses:
        '200':
          description: '{settled:false, test:true, confirmations, minimum_confirmations, hash} | {settled:true, test:true, ...}'
        '403':
          description: uxc_not_sandbox (not a test-mode resource) | uxc_publishable_key
        '410':
          description: challenge expired or already settled
      operationId: postV1SimulatePayment
      x-operation-id-source: derived
  /r/{id}:
    get:
      tags:
      - Buy
      summary: The 402 door (back-compat alias of pay.u.cash /checkout/; same engine, same…
      security: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '402':
          description: accepts[] + paymentRequirements[]
        '200':
          description: settled or the HTML page
        '202':
          description: exact payment verified, pending on-chain settlement
      operationId: getRById
      x-operation-id-source: derived
  /v1/exact-verify:
    post:
      tags:
      - Buy
      summary: 'x402 facilitator verify: is this signed EIP-3009 USDC-on-Base payment…'
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                x402Version:
                  type: integer
                paymentPayload:
                  type: object
                paymentRequirements:
                  type: object
                  description: carries resource (the /r/{res_id} URL)
      responses:
        '200':
          description: '{isValid, invalidReason?, payer}'
      operationId: postV1ExactVerify
      x-operation-id-source: derived
  /v1/exact-settle:
    post:
      tags:
      - Buy
      summary: 'x402 facilitator settle: verify the signed payment AND settle (relay by…'
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                x402Version:
                  type: integer
                paymentPayload:
                  type: object
                paymentRequirements:
                  type: object
      responses:
        '200':
          description: '{success, transaction, network, payer, errorReason?}. Hard failures (bad signature, expiry, payee mismatch, no open challenge) ALSO return this shape with success:false + errorReason.'
      operationId: postV1ExactSettle
      x-operation-id-source: derived
  /relayer/{id}:
    get:
      tags:
      - Buy
      summary: 'Public: is this resource sponsored by a gasless relayer?'
      security: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: '{res_id, configured, active, funding, funded_address, balance, network, pay_to}'
        '404':
          description: resource not found
      operationId: getRelayerById
      x-operation-id-source: derived
components:
  schemas:
    Verify:
      type: object
      required:
      - challengeId
      - hash
      properties:
        challengeId:
          type: string
          description: from an accepts[] entry
        hash:
          type: string
          description: on-chain transaction hash
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: The api_key from POST /v1/signup.