---
title: X402 Payments
full: true
_openapi:
  toc:
    - depth: 2
      title: Transparent X402 Payment Proxy
      url: '#transparent-x402-payment-proxy'
    - depth: 2
      title: Sign X402 Payment Proof
      url: '#sign-x402-payment-proof'
  structuredData:
    headings:
      - content: Transparent X402 Payment Proxy
        id: transparent-x402-payment-proxy
      - content: Sign X402 Payment Proof
        id: sign-x402-payment-proof
    contents:
      - content: >
          Fetch any URL with automatic X402 payment handling. If the target URL
          returns

          a 402 Payment Required response, AgnicPay automatically signs the
          payment and

          retries the request. You get the actual API response back.


          **This is the recommended endpoint for most use cases.**
        heading: transparent-x402-payment-proxy
      - content: >
          Sign an X402 payment proof for manual payment handling. Supports both
          "exact"

          (EIP-3009 TransferWithAuthorization) and "upto" (EIP-2612 Permit)
          payment schemes.


          The easiest approach is to pass the full 402 response from the X402
          API directly

          as the `paymentRequirements` field.
        heading: sign-x402-payment-proof
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

X402 payment signing and proxying

<APIPage document={"content/openapi/agnicpay.yaml"} operations={[{"path":"/api/x402/fetch","method":"post"},{"path":"/api/sign-payment","method":"post"}]} webhooks={[]} hasHead={true} />