Skip to main content

Machine-payable protocol API

Create and manage ECDSA wallets for agents to make autonomous payments using the x402 machine-payable protocol. Agents can hold USDC balances and make HTTP requests that include automatic payment negotiation.
All MPP endpoints require session authentication. Wallet private keys are stored server-side and cannot be retrieved after creation.

List wallets

Returns all registered agent wallets.

Response

FieldTypeDescription
walletsarrayList of registered agent wallets
wallets[].agentIdstringAgent identifier
wallets[].companyIdstringCompany identifier
wallets[].addressstringWallet address (hex format)

Get wallet

Returns the wallet address for a specific agent.

Query parameters

ParameterTypeRequiredDescription
actionstringYesMust be get-wallet
agentIdstringYesAgent identifier

Response

Errors

CodeDescription
404Wallet not found for the specified agent

Get balance

Returns the USDC balance for an agent’s wallet.

Query parameters

ParameterTypeRequiredDescription
actionstringYesMust be get-balance
agentIdstringYesAgent identifier

Response

Errors

CodeDescription
500Failed to fetch balance (for example, RPC error)

List endpoints

When no action parameter is provided, returns the list of available endpoints.

Create wallet

Creates a new ECDSA wallet for an agent. The private key is stored server-side and cannot be retrieved.

Request body

FieldTypeRequiredDescription
actionstringYesMust be create-wallet
agentIdstringYesAgent identifier
companyIdstringYesCompany identifier

Response

Errors

CodeDescription
400agentId and companyId required

Register wallet

Registers an existing wallet for an agent by providing its private key.

Request body

FieldTypeRequiredDescription
actionstringYesMust be register-wallet
agentIdstringYesAgent identifier
companyIdstringYesCompany identifier
privateKeystringYesWallet private key (hex format)

Response

Errors

CodeDescription
400agentId, companyId, and privateKey required

Make payment

Makes an HTTP request on behalf of an agent with automatic x402 payment negotiation. When the target URL returns a 402 Payment Required response, the agent’s wallet is used to authorize the payment.

Request body

FieldTypeRequiredDescription
actionstringYesMust be make-payment
agentIdstringYesAgent identifier (must have a registered wallet)
urlstringYesTarget URL to request
methodstringNoHTTP method (default: GET)
headersobjectNoAdditional request headers
bodyobjectNoRequest body (JSON-serialized automatically)

Response

FieldTypeDescription
resultanyThe response from the target URL after payment negotiation

Errors

CodeDescription
400url required
400Invalid action
402Payment failed (for example, insufficient balance or payment negotiation error)
500Internal error

Common errors

CodeDescription
401Unauthorized — session authentication required
500Internal error