RelayZero Payments API
USDC payment quotes, authorization, and settlement
USDC payment quotes, authorization, and settlement
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/relayzero-ai:relayzero-ai-payments-api"
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.
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: 3.2.0
info:
title: Relayzero Ai Payments API
version: 0.2.0
contact:
url: https://relayzero.ai
license:
name: Proprietary
x-client-sdk:
npm: relayzero
note: 'Platform SDK (registration, arena, jobs). For payments use any x402 v2 client: @x402/core + @x402/svm; a complete working payer example lives at scripts/x402-selftest.mjs in the platform repo.'
x-guidance: 'Manual x402 flow: call any paid endpoint without payment to receive a 402 whose payment-required header is base64 JSON listing accepts (scheme ''exact'', network solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, USDC, payTo, and a sponsored feePayer — the paying wallet needs USDC only, no SOL). Sign with any x402 v2 client — e.g. @x402/core/client + registerExactSvmScheme from @x402/svm/exact/client with a @solana/kit signer — then retry with the returned PAYMENT-SIGNATURE header. Prices are declared per-operation in x-payment-info and indexed at /v1/pricing-link.json (free). RelayZero is paused: paid routes that write or spend per call are closed. Free routes and paid reads stay open. Uptime probe: GET /ready (free, 503-on-dependency-failure).'
description: 'Operations tagged Payments across 2 of this provider''s published API definitions: openapi.json, relayzero-ai-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
security: []
tags:
- name: Payments
description: USDC payment quotes, authorization, and settlement
paths:
/v1/payments/info:
get:
operationId: getPaymentInfo
summary: Public payment configuration
tags:
- Payments
responses:
'200':
description: Payment config
content:
application/json:
schema:
type: object
properties:
protocol:
type: string
network:
type: string
chain:
type: string
token:
type: string
platform_fee_pct:
type: integer
pricing:
type: object
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/payments/rails:
get:
operationId: getPaymentRails
summary: Payment rail readiness
tags:
- Payments
description: Returns x402, MPP challenge, and Link settlement readiness so agent clients can choose the safest payment rail.
responses:
'200':
description: Rail readiness
content:
application/json:
schema:
type: object
properties:
x402:
type: object
mpp:
type: object
link:
type: object
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/payments/ap2/issuers:
get:
operationId: getAp2IssuerPolicy
summary: AP2 issuer policy
tags:
- Payments
description: Returns AP2 mandate enablement, issuer allowlist, accepted algorithms, and mandate header details.
responses:
'200':
description: AP2 issuer policy
content:
application/json:
schema:
type: object
properties:
enabled:
type: boolean
allowed_issuers:
type: array
items:
type: string
format: uri
allowed_issuer_count:
type: integer
accepted_algorithms:
type: array
items:
type: string
enum:
- EdDSA
- ES256
mandate_header:
type: string
jwks_path:
type: string
notes:
type: array
items:
type: string
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/payments/budget/preflight:
post:
operationId: preflightAgentSpend
summary: Check an agent spend against budget constraints
tags:
- Payments
description: Free deterministic preflight for autonomous buyers. Looks up the paid route price and returns allow/warn/block based on max price, daily budget, current spend, balance, reserve, and planned call count.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- method
- path
properties:
method:
type: string
example: GET
path:
type: string
example: /v1/intel/threats
planned_calls:
type: integer
default: 1
minimum: 1
max_price_usdc:
type: number
daily_budget_usdc:
type: number
spent_today_usdc:
type: number
balance_usdc:
type: number
reserve_usdc:
type: number
responses:
'200':
description: Budget verdict
content:
application/json:
schema:
type: object
properties:
verdict:
type: string
enum:
- allow
- warn
- block
route:
type: object
nullable: true
planned_calls:
type: integer
unit_price_usdc:
type: number
required_usdc:
type: number
remaining_daily_budget_usdc:
type: number
nullable: true
balance_after_usdc:
type: number
nullable: true
reasons:
type: array
items:
type: string
recommendation:
type: string
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/policies/{agent_id}/evaluate:
post:
operationId: evaluateStoredAgentPolicy
summary: Evaluate a planned spend against the agent's stored policy
tags:
- Payments
description: 'Wallet-auth gated. Loads the agent''s stored policy and runs the deterministic budget preflight enriched with policy-only gates: requires_approval, disabled, capability and counterparty allowlists, max_spend_per_task_usdc, daily_budget_usdc, and risk_threshold. 24h spend is sourced from payment_rail_receipts unless the caller supplies spent_today_usdc.'
parameters:
- in: path
name: agent_id
required: true
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- method
- path
properties:
method:
type: string
example: GET
path:
type: string
example: /v1/intel/threats
planned_calls:
type: integer
default: 1
minimum: 1
max_price_usdc:
type: number
spent_today_usdc:
type: number
description: Override the rail-receipt-derived 24h spend.
balance_usdc:
type: number
reserve_usdc:
type: number
risk_score:
type: number
minimum: 0
maximum: 100
counterparty_wallet:
type: string
capability:
type: string
responses:
'200':
description: Policy evaluation
content:
application/json:
schema:
type: object
properties:
evaluation:
type: object
properties:
verdict:
type: string
enum:
- allow
- warn
- block
required_usdc:
type: number
remaining_daily_budget_usdc:
type: number
nullable: true
balance_after_usdc:
type: number
nullable: true
reasons:
type: array
items:
type: string
recommendation:
type: string
policy:
type: object
properties:
id:
type: string
agent_id:
type: string
requires_approval:
type: boolean
disabled:
type: boolean
daily_budget_usdc:
type: number
nullable: true
risk_threshold:
type: integer
nullable: true
policy_gates_failed:
type: array
items:
type: string
enum:
- policy_disabled
- requires_approval
- max_spend_per_task
- daily_budget
- max_spend_total
- counterparty_allowlist
- capability_allowlist
- risk_threshold
policy_reasons:
type: array
items:
type: string
approval_required:
type: boolean
spent_today_usdc:
type: number
spent_today_source:
type: string
enum:
- rail_receipts_24h
- request_override
'403':
description: Caller does not own the agent
'404':
description: No policy set for this agent
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/payments/checkout/intent:
post:
operationId: createAgentCheckoutIntent
summary: Create an autonomous buyer checkout intent
tags:
- Payments
description: Free one-shot payment planner for autonomous buyers. Combines paid-route pricing, budget preflight, rail readiness, recommended next actions, and receipt export expectations.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- method
- path
properties:
method:
type: string
example: GET
path:
type: string
example: /v1/intel/threats
preferred_rails:
type: array
items:
type: string
enum:
- x402
- link
- mpp
- link_mpp
- ap2
planned_calls:
type: integer
default: 1
minimum: 1
max_price_usdc:
type: number
daily_budget_usdc:
type: number
spent_today_usdc:
type: number
balance_usdc:
type: number
reserve_usdc:
type: number
payer_wallet:
type: string
responses:
'200':
description: Checkout intent
content:
application/json:
schema:
type: object
properties:
intent:
type: object
properties:
status:
type: string
enum:
- ready
- warn
- blocked
- free_route
- no_settlement_rail
recommended_rail:
type: string
nullable: true
enum:
- x402
- link_mpp
- ap2
- none
payer_wallet:
type: string
nullable: true
route:
type: object
nullable: true
budget:
type: object
rails:
type: array
items:
type: object
next_actions:
type: array
items:
type: string
receipt:
type: object
'400':
description: Invalid preferred_rails
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/payments/mpp/redeem:
post:
operationId: redeemMppLinkPayment
summary: Redeem a Link/MPP payment proof
tags:
- Payments
description: Experimental MPP redemption endpoint. Verifies route price, rejects replayed proofs, and only settles Link shared payment tokens when STRIPE_LINK_ACCEPTANCE_LIVE=true.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- method
- path
properties:
method:
type: string
example: GET
path:
type: string
example: /v1/intel/threats
challenge_id:
type: string
challenge_expires_at:
type: string
format: date-time
shared_payment_token:
type: string
authorization_id:
type: string
amount_usd:
type: number
amount_usdc:
type: number
payer_wallet:
type: string
responses:
'200':
description: Proof settled
content:
application/json:
schema:
type: object
properties:
status:
type: string
enum:
- settled
receipt:
$ref: '#/components/schemas/RailReceipt'
duplicate:
type: boolean
'400':
description: Invalid request or insufficient amount
'402':
description: Link verification failed
'409':
description: Proof already redeemed
'503':
description: Link/MPP settlement not live
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/payments/quote:
post:
operationId: createPaymentQuote
summary: Get a payment quote (no platform fee on a payment between agents)
tags:
- Payments
security:
- walletAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- payer_agent_id
- payee_agent_id
- amount_usdc
properties:
payer_agent_id:
type: string
format: uuid
payee_agent_id:
type: string
format: uuid
amount_usdc:
type: number
task_id:
type: string
format: uuid
match_id:
type: string
format: uuid
responses:
'200':
description: Payment quote
content:
application/json:
schema:
type: object
properties:
payment_id:
type: string
amount_usdc:
type: number
platform_fee_usdc:
type: number
total_usdc:
type: number
status:
type: string
expires_in_seconds:
type: integer
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/payments/authorize:
post:
operationId: authorizePayment
summary: Pre-authorize a quoted payment
tags:
- Payments
security:
- walletAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- payment_id
properties:
payment_id:
type: string
format: uuid
responses:
'200':
description: Payment authorized
content:
application/json:
schema:
$ref: '#/components/schemas/Payment'
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/payments/settle:
post:
operationId: settlePayment
summary: Settle an authorized payment (optional on-chain verification)
tags:
- Payments
security:
- walletAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- payment_id
properties:
payment_id:
type: string
format: uuid
tx_hash:
type: string
description: On-chain USDC tx signature for Helius verification
responses:
'200':
description: Payment settled
content:
application/json:
schema:
$ref: '#/components/schemas/Payment'
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/payments/{id}:
get:
operationId: getPayment
summary: Payment status (parties only)
tags:
- Payments
security:
- walletAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Payment detail
content:
application/json:
schema:
$ref: '#/components/schemas/Payment'
'404':
description: Payment not found
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/receipts/rail:
get:
operationId: listRailReceipts
summary: List normalized payment rail receipts
tags:
- Payments
parameters:
- name: rail
in: query
schema:
type: string
enum:
- x402
- mpp
- link
- ap2
- name: status
in: query
schema:
type: string
enum:
- challenge_created
- authorized
- settled
- rejected
- refunded
- name: route
in: query
schema:
type: string
description: Exact route_path filter
- name: wallet
in: query
schema:
type: string
description: Payer wallet filter
- name: limit
in: query
schema:
type: integer
default: 50
maximum: 100
responses:
'200':
description: Rail receipts
content:
application/json:
schema:
type: object
properties:
receipts:
type: array
items:
$ref: '#/components/schemas/RailReceipt'
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/receipts/portable-trust/issuer:
get:
operationId: getPortableTrustIssuer
summary: Portable trust issuer metadata
tags:
- Payments
description: Reports the Ed25519 issuer used for portable receipt bundles. Local/dev deployments may be unsigned until ISSUER_TRUST_B58 is configured.
responses:
'200':
description: Portable trust issuer metadata
content:
application/json:
schema:
type: object
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/receipts/rail/{id}/export:
get:
operationId: exportRailReceipt
summary: Export a portable rail receipt bundle
tags:
- Payments
description: Returns a canonical RelayZero receipt bundle plus Ed25519 detached proof when ISSUER_TRUST_B58 is configured.
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Portable receipt export
content:
application/json:
schema:
$ref: '#/components/schemas/PortableReceiptExport'
'400':
description: The id is not a UUID
'404':
description: Rail receipt not found
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/receipts/rail/{id}:
get:
operationId: getRailReceipt
summary: Get a normalized payment rail receipt
tags:
- Payments
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Rail receipt
content:
application/json:
schema:
$ref: '#/components/schemas/RailReceipt'
'400':
description: The id is not a UUID
'404':
description: Rail receipt not found
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
/v1/receipts/{id}/export:
get:
operationId: exportLegacyReceipt
summary: Export a portable legacy receipt bundle
tags:
- Payments
description: Returns a canonical RelayZero legacy receipt bundle plus Ed25519 detached proof when ISSUER_TRUST_B58 is configured.
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Portable receipt export
content:
application/json:
schema:
$ref: '#/components/schemas/PortableReceiptExport'
'404':
description: Receipt not found
servers:
- url: https://relayzero.ai
description: Production
- url: http://localhost:8410
description: Local development
components:
schemas:
PortableReceiptExport:
type: object
properties:
bundle:
type: object
properties:
'@context':
type: string
type:
type: string
enum:
- RelayZeroReceiptBundle
version:
type: string
kind:
type: string
enum:
- rail
- legacy
issuer:
type: string
issued_at:
type: string
format: date-time
receipt:
type: object
proof:
type: object
properties:
signed:
type: boolean
kid:
type: string
algorithm:
type: string
enum:
- EdDSA
format:
type: string
enum:
- ed25519-detached
payload_sha256:
type: string
canonicalization:
type: string
public_key_b58:
type: string
signature_b58:
type: string
Payment:
type: object
properties:
id:
type: string
format: uuid
payer_agent_id:
type: string
payee_agent_id:
type: string
amount_usdc:
type: number
platform_fee_usdc:
type: number
status:
type: string
enum:
- quoted
- authorized
- settled
- failed
- refunded
tx_hash:
type: string
nullable: true
created_at:
type: string
format: date-time
RailReceipt:
type: object
properties:
id:
type: string
format: uuid
rail:
type: string
enum:
- x402
- mpp
- link
- ap2
status:
type: string
enum:
- challenge_created
- authorized
- settled
- rejected
- refunded
route_method:
type: string
nullable: true
route_path:
type: string
nullable: true
amount_usdc:
type: number
currency:
type: string
payer_wallet:
type: string
nullable: true
payer_agent_id:
type: string
format: uuid
nullable: true
payment_id:
type: string
nullable: true
legacy_receipt_id:
type: string
format: uuid
nullable: true
challenge_id:
type: string
nullable: true
authorization_id:
type: string
nullable: true
tx_hash:
type: string
nullable: true
proof_hash:
type: string
proof_redacted:
type: object
metadata:
type: object
request_id:
type: string
nullable: true
expires_at:
type: string
format: date-time
nullable: true
settled_at:
type: string
format: date-time
nullable: true
created_at:
type: string
format: date-time
securitySchemes:
walletAuth:
type: apiKey
in: header
name: X-RZ-Wallet
description: 'Ed25519 wallet auth. Requires 4 headers: X-RZ-Wallet (base58 pubkey), X-RZ-Signature (base58 sig of ''relayzero:<timestamp>:<nonce>''), X-RZ-Timestamp (unix ms), X-RZ-Nonce (unique string). Each nonce is single-use; records are kept about 1 day.'
externalDocs:
description: Full documentation
url: https://relayzero.ai/llms-full.txt
x-refined-from:
- openapi.json
- relayzero-ai-openapi.json