Customer documentation

Accept payments from agents, scripts, and API clients.

AgentPay sits in front of your API, handles payment negotiation and verification, forwards paid requests to your backend, and gives agents a discovery document they can use to understand how to call you.

Overview

What AgentPay Does

AgentPay turns your existing API into a paid API without requiring clients to integrate with your backend directly. You configure projects, payment channels, endpoints, and optional backend headers in the dashboard. Clients then call generated AgentPay URLs. If payment is missing or invalid, the client receives a protocol-specific HTTP 402 response. If payment is valid, the request is forwarded to your backend and the backend response is returned to the client.

One paid entry point

Publish payment-protected URLs while keeping your backend URL private from clients that do not need it.

Multiple payment channels

Offer wallet-native, testnet, token, and card-backed flows from the same project.

Agent-ready discovery

Generated OpenAPI metadata tells agents which routes exist and which payment protocols are accepted.

Start here

Quickstart

1

Create a project

A project groups one customer-facing API, its payment channels, its endpoints, and the generated discovery document.

2

Enable payment channels

Choose the protocols your clients can use. Testnet channels are available for validation before production traffic.

3

Add endpoints

Each endpoint maps a public slug to your backend URL, request method, schemas, and optional parameters.

4

Share generated URLs

Clients call the AgentPay URL instead of your backend URL. AgentPay collects payment, then forwards valid requests.

# Generated URL shape
https://agent-proxy.alchemy.com/v1/{protocol}/{projectId}/{endpointSlug}/{path}

# Example testnet call without payment; this should return HTTP 402
curl https://agent-proxy.alchemy.com/v1/x402-testnet/{projectId}/chat/messages

Launch checklist

Onboarding Steps

  1. Create your account and team.Sign up, confirm you can access the dashboard, and pick the plan that matches your launch stage. Free is intended for testnet validation.
  2. Create a project.Give the project a customer-facing name and description. This information appears in generated discovery metadata.
  3. Enable one or more payment channels.Start with x402 Testnet or MPP Tempo Testnet. Add mainnet or card-backed channels after your client flow is working end to end.
  4. Add endpoints.For each API surface, set a slug, HTTP method, backend URL, request schema, response schema, and any public parameters agents should know about.
  5. Add backend headers if needed.Use custom headers for secrets your backend expects, such as internal API keys. These are injected into forwarded requests and are not part of the public URL.
  6. Test unpaid and paid requests.First confirm unpaid requests return 402. Then confirm a paid retry reaches your backend, returns the expected payload, and includes a payment response header.
  7. Publish your URLs and discovery document.Share protocol-specific URLs with clients and give agents the OpenAPI discovery URL so they can inspect routes and payment metadata.

Model

Core Concepts

Team
The billing and access boundary for your account. Usage limits, plan access, and project ownership apply at the team level.
Project
A collection of payment channels and API endpoints. A project gets a stable project ID used in every proxy URL.
Payment channel
A protocol-specific way to collect money. Channels are enabled at the project level and apply to all enabled endpoints in that project.
Endpoint
A named route that AgentPay exposes to clients. It contains the backend URL, HTTP method, schemas, and forwarding rules.
Endpoint slug
The short lowercase identifier in the public URL, such as chat, search, enrich, or quote.
Discovery document
A generated OpenAPI document that describes your paid API routes and the payment metadata agents need to call them.

Runtime

How Requests Work

  1. Client calls an AgentPay URL for a specific protocol, project, and endpoint.
  2. AgentPay loads your project configuration and verifies the endpoint is enabled.
  3. AgentPay checks for the payment credential required by that protocol.
  4. If payment is missing, AgentPay returns HTTP 402 with payment instructions.
  5. If payment is present, AgentPay verifies the credential against the configured channel.
  6. When verification succeeds, AgentPay forwards the request body, method, query string, and allowed headers to your backend.
  7. Your backend response is returned to the client with payment settlement metadata.
Your backend stays focused on product logic.

It receives a normal HTTP request after payment succeeds. You can keep existing authentication, rate limiting, and business logic in place.

Reference

Proxy URL Structure

https://agent-proxy.alchemy.com/v1/{protocol}/{projectId}/{endpointSlug}/{path}
SegmentMeaningExample
{protocol}The payment channel selected by the client.x402-testnet
{projectId}The stable project ID generated in the dashboard.9d43f844c1bfd20d
{endpointSlug}The endpoint slug you configured.chat
{path}Additional path appended to your backend URL.v1/messages

Query parameters are preserved and forwarded. For example, a request to /v1/x402/{projectId}/search/items?q=books forwards q=books to the configured backend endpoint after payment passes.

DNS

Custom Domains

Paid teams can attach one custom domain to each project. After a custom domain is active, clients can use shorter URLs without the project ID segment.

# Standard AgentPay URL
https://agent-proxy.alchemy.com/v1/{protocol}/{projectId}/{endpointSlug}/{path}

# Custom domain URL
https://api.example.com/v1/{protocol}/{endpointSlug}/{path}

# Custom domain discovery
https://api.example.com/openapi.json

Setup steps

  1. Open Project Settings in the dashboard.
  2. Enter a hostname you control, such as api.example.com.
  3. Save the project.
  4. Create the CNAME record shown in the dashboard with your DNS provider.
  5. Wait for the domain and certificate status to become active.

DNS record

The dashboard shows the exact CNAME target for your environment. DNS propagation and certificate issuance can take a few minutes. Use the refresh button in the dashboard if you want to check Cloudflare status immediately.

Discovery

OpenAPI Discovery

Every project can expose a generated OpenAPI document. It describes the public AgentPay routes, request and response schemas, enabled operations, and the x-payment-info metadata agents use to understand supported payment protocols and prices.

# Project-scoped discovery URL
https://agent-proxy.alchemy.com/v1/{projectId}/openapi.json

# Alternate discovery URL
https://agent-proxy.alchemy.com/openapi.json?projectId={projectId}
Keep endpoint descriptions useful.

Agent clients rely on names, descriptions, parameter schemas, and response schemas to decide whether your API is the right tool for a task.

Protocols

Protocol Pages

A project can enable more than one channel. Each channel gets its own URL segment, credential format, and 402 response shape. Share the protocol URL that matches the client's payment capability.

Protocol page

x402

x402 uses the HTTP 402 pattern. When a request arrives without payment, AgentPay returns machine-readable payment requirements. For EVM USDC networks, Circle Gateway nanopayments are returned as an additional x402 payment option using the same recipient address. The client signs a matching payment payload, retries with the payment header, and receives the backend response after verification.

Production crypto paymentsPaid plans
URL segmentx402
Payment headerPAYMENT-SIGNATURE
Best for

Wallet-native agents, autonomous scripts, and API consumers that can sign per-request payments.

https://agent-proxy.alchemy.com/v1/x402/{projectId}/{endpointSlug}/{path}

Setup

  1. Enable the x402 channel in the dashboard.
  2. Select Base, Solana, or both as accepted networks.
  3. Enter the recipient address for each enabled network.
  4. Set a price per request. USDC uses 6 decimal places, so 10000 is $0.01.
  5. Save the channel and test the generated URL before sharing it publicly.

Runtime flow

  1. Client calls the x402 URL without a payment header.
  2. AgentPay returns HTTP 402 with an accepts array describing network, asset, amount, recipient, and timeout.
  3. Client signs the payment payload for one accepted requirement.
  4. Client retries the same URL with PAYMENT-SIGNATURE.
  5. AgentPay verifies the payment, forwards the request to your backend, settles the payment, and adds PAYMENT-RESPONSE to the response.

Implementation notes

  • The resource URL in the signed payload must exactly match the URL being requested.
  • Circle Gateway nanopayments are automatically available for EVM USDC x402 networks and are not supported for Solana.
  • A changed price, recipient, network, asset, or request URL invalidates previously signed payloads.
  • Use x402 Testnet first when you are validating an agent integration.

Protocol page

x402 Testnet

x402 Testnet follows the same request and signing flow as x402, but uses test networks so you can validate pricing, wallet handling, retries, and settlement behavior before launch.

Testnet crypto paymentsFree and paid plans
URL segmentx402-testnet
Payment headerPAYMENT-SIGNATURE
Best for

End-to-end agent payment testing without production funds.

https://agent-proxy.alchemy.com/v1/x402-testnet/{projectId}/{endpointSlug}/{path}

Setup

  1. Enable x402 Testnet in the dashboard.
  2. Select Base Sepolia, Solana Devnet, or both.
  3. Enter a testnet recipient address for each enabled network.
  4. Set a test price and save the channel.
  5. Fund the client wallet with test assets on the selected network.

Runtime flow

  1. Client calls the x402-testnet URL.
  2. AgentPay returns a 402 response with testnet payment requirements.
  3. Client signs and retries with PAYMENT-SIGNATURE.
  4. AgentPay verifies against the selected test network and forwards the paid request.

Implementation notes

  • Use this channel for integration tests, demos, and onboarding new agents.
  • Testnet balances and transactions have no production value.
  • Keep testnet URLs separate from production instructions so clients do not sign for the wrong network.

Protocol page

MPP Tempo

MPP Tempo issues a payment challenge through the standard Authorization flow. The client satisfies the challenge with a Payment credential, and AgentPay verifies and charges the credential before forwarding the backend request.

Production MPP paymentsPaid plans
URL segmentmpp-tempo
Payment headerAuthorization
Best for

Clients that support Managed Payment Protocol credentials and want token settlement on Tempo mainnet.

https://agent-proxy.alchemy.com/v1/mpp-tempo/{projectId}/{endpointSlug}/{path}

Setup

  1. Enable MPP Tempo in the dashboard.
  2. Enter the recipient wallet address on Tempo mainnet.
  3. Enter the token contract address clients should pay with.
  4. Set the price per request in token units.
  5. Save the channel and test an unpaid request to confirm the challenge is returned.

Runtime flow

  1. Client calls the mpp-tempo URL without an Authorization payment credential.
  2. AgentPay returns HTTP 402 with an MPP challenge.
  3. Client obtains or creates a matching Payment credential.
  4. Client retries with Authorization set to the Payment credential.
  5. AgentPay verifies and charges the credential, then forwards the request to your backend.

Implementation notes

  • Prices are entered as decimal token units for MPP channels.
  • The recipient and token address must match the network your clients are using.
  • MPP settlement happens during verification, so invalid credentials are rejected before your backend receives the request.

Protocol page

MPP Tempo Testnet

MPP Tempo Testnet mirrors the production MPP Tempo flow on a test network. It is the recommended first step when you are validating MPP-capable clients or agent frameworks.

Testnet MPP paymentsFree and paid plans
URL segmentmpp-tempo-testnet
Payment headerAuthorization
Best for

Testing MPP credential handling and token payment flows before production.

https://agent-proxy.alchemy.com/v1/mpp-tempo-testnet/{projectId}/{endpointSlug}/{path}

Setup

  1. Enable MPP Tempo Testnet in the dashboard.
  2. Enter the testnet recipient wallet address.
  3. Enter the test token contract address.
  4. Set a decimal price per request.
  5. Call the generated URL and confirm the 402 challenge is returned.

Runtime flow

  1. Client calls the mpp-tempo-testnet URL.
  2. AgentPay returns a 402 MPP challenge.
  3. Client retries with an Authorization payment credential.
  4. AgentPay verifies the credential on the test network and forwards the request.

Implementation notes

  • This channel is available on the Free plan for onboarding and validation.
  • Use separate test recipient addresses and test tokens.
  • Move to MPP Tempo only after the client can reliably handle challenge, payment, retry, and error cases.

Protocol page

MPP Stripe

MPP Stripe uses the MPP challenge and credential flow while charging card-backed payment methods behind the scenes. It is useful when your buyers or agents need card rails rather than wallet balances.

Card-backed MPP paymentsPaid plans
URL segmentmpp-stripe
Payment headerAuthorization
Best for

Customers who want MPP-compatible payments backed by card payment methods.

https://agent-proxy.alchemy.com/v1/mpp-stripe/{projectId}/{endpointSlug}/{path}

Setup

  1. Enable MPP Stripe in the dashboard.
  2. Enter your Stripe secret key. Existing saved keys stay hidden and can be left unchanged.
  3. Set the price per request in USD.
  4. Optionally set a network ID if your integration uses one.
  5. Save and test an unpaid request to confirm the MPP challenge is returned.

Runtime flow

  1. Client calls the mpp-stripe URL without an Authorization payment credential.
  2. AgentPay returns a 402 challenge for card-backed payment.
  3. Client completes the challenge and retries with Authorization.
  4. AgentPay verifies and charges the credential, then forwards the request.

Implementation notes

  • Store payment processor keys carefully and rotate them if access changes.
  • Prices are entered as USD decimal values, such as 0.05.
  • This channel is useful for human-in-the-loop clients as well as agents that can use card-backed credentials.

Clients

Setting Up Agents

Agents should be given the discovery document, one or more starting URLs, and clear spend limits. For x402 channels, the agent needs access to a funded wallet and signing code. For MPP channels, the agent or client runtime needs to understand the returned MPP challenge and retry with the correct Authorization credential.

Recommended agent inputs

  • OpenAPI discovery URL for the project.
  • Allowed protocols and whether they are testnet or production.
  • Maximum spend per request and per time window.
  • Wallet or payment credential access for the chosen protocol.
  • Retry limits for failed, expired, or declined payments.

Agent Payment Skill

The Agent Payment Skill gives compatible agents instructions for discovering paid endpoints, handling 402 responses, signing x402 payloads, and retrying requests.

View skill

Usage

Plans and Limits

Plans control project count, monthly request volume, production channel access, and whether overage or custom volume terms apply. The dashboard shows current usage and highlights when your team is approaching its limit.

PlanBest forChannel accessNotes
FreeInitial integration testsTestnet channelsUse before sending production traffic.
GrowthProduction launchesMainnet and testnet channelsIncludes higher monthly request volume and overage options.
EnterpriseHigh volume and custom requirementsMainnet, testnet, and account-enabled channelsSupports custom volume and operational terms.
View pricing

Operations

Security Checklist

  • Use testnet channels before sharing production URLs.
  • Keep backend secrets in custom headers rather than public URL parameters.
  • Do not expose payment processor secret keys in client-side code or agent prompts.
  • Set strict agent spend limits and alert on unexpected usage.
  • Validate that your backend only performs paid actions after AgentPay forwards the request.
  • Rotate keys and recipient addresses when ownership or operational access changes.

Help

Troubleshooting

SymptomLikely causeFix
402 Payment RequiredThe request did not include a valid payment credential.Read the response body or challenge, create payment, and retry the same URL.
Unknown payment protocolThe URL segment does not match an available channel.Use one of the protocol segments shown in the dashboard for that project.
Payment channel is not configuredThe project does not have that channel enabled.Enable the channel in the dashboard or switch to a configured protocol URL.
Payment resource URL does not matchThe client signed one URL but requested another.Sign the exact URL, including path and query string, that will be retried.
Usage limit exceededYour team has reached the plan limit for the current period.Review usage in the dashboard and upgrade or wait for the next period.

Still stuck?

Capture the request URL, protocol, response status, and response body from the failed call. Those details usually identify whether the issue is channel setup, client signing, backend routing, or plan limits.