AgentPay Labs AP2 API

Agent Payment Protocol v2 endpoints

Operations 4

POST /api/ap2/request AP2 payment request #
POST /api/ap2/receipt AP2 receipt #
POST /api/ap2/confirm AP2 confirm #
GET /api/ap2/status/{id} AP2 transaction status #

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/agentpay-so:agentpay-so-ap2-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

agentpay-so-ap2-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AgentPay AP2 API
  description: '**AgentPay public API for Bro and train-first agent commerce.**

    This OpenAPI document is limited to the Cloudflare Workers production surface.

    Legacy Node-only routes are intentionally excluded until they are migrated.


    ## Authentication

    All protected endpoints require an API key via:

    - `Authorization: Bearer ` header, or

    - `X-Api-Key: ` header


    ## Protocols Supported

    - **x402** — HTTP 402 paywall standard

    - **ACP** — Agent Communication Protocol

    - **AP2** — Agent Payment Protocol v2

    - **Solana Pay** — Solana USDC native

    - **Stripe** — Fiat card / bank payments


    Get your API key: `POST /api/merchants/register`'
  version: 1.0.0
  contact:
    name: AgentPay Support
    url: https://docs.agentpay.gg
    email: support@agentpay.gg
  license:
    name: BSL-1.1; AGPL-3.0 after 2029-01-01
    url: https://github.com/Rumblingb/Agentpay/blob/main/LICENSE
servers:
- url: https://api.agentpay.so
  description: Production (Cloudflare Workers)
- url: http://localhost:8787
  description: Local Workers dev (wrangler dev)
tags:
- name: AP2
  description: Agent Payment Protocol v2 endpoints
paths:
  /api/ap2/request:
    post:
      tags:
      - AP2
      summary: AP2 payment request
      description: Initiate an AP2 payment (step 1 of 3)
      operationId: ap2Request
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Ap2RequestBody'
      responses:
        '201':
          description: AP2 request created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Ap2RequestResponse'
  /api/ap2/receipt:
    post:
      tags:
      - AP2
      summary: AP2 receipt
      description: Payee issues a signed receipt after completing the task (step 2 of 3)
      operationId: ap2Receipt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Ap2ReceiptBody'
      responses:
        '201':
          description: Receipt issued
  /api/ap2/confirm:
    post:
      tags:
      - AP2
      summary: AP2 confirm
      description: Payer confirms receipt and releases funds (step 3 of 3)
      operationId: ap2Confirm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Ap2ConfirmBody'
      responses:
        '200':
          description: Payment confirmed
  /api/ap2/status/{id}:
    get:
      tags:
      - AP2
      summary: AP2 transaction status
      description: Get the current status of an AP2 transaction
      operationId: ap2Status
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Transaction status
components:
  schemas:
    Ap2ConfirmBody:
      type: object
      required:
      - requestId
      - receiptId
      - payerConfirmation
      properties:
        requestId:
          type: string
          format: uuid
        receiptId:
          type: string
          format: uuid
        payerConfirmation:
          type: string
    Ap2RequestResponse:
      type: object
      properties:
        success:
          type: boolean
        requestId:
          type: string
          format: uuid
        transaction:
          type: object
    Ap2RequestBody:
      type: object
      required:
      - payerId
      - payeeId
      - amountUsdc
      - taskDescription
      properties:
        payerId:
          type: string
        payeeId:
          type: string
        amountUsdc:
          type: number
        taskDescription:
          type: string
        callbackUrl:
          type: string
          format: uri
        ttlSeconds:
          type: integer
          default: 300
    Ap2ReceiptBody:
      type: object
      required:
      - requestId
      - payeeSignature
      properties:
        requestId:
          type: string
          format: uuid
        payeeSignature:
          type: string
        completionProof:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Format: ''Bearer <api_key>'' or just ''<api_key>'''