A-Pay Protocol

v0.1.8
io.github.neuralaisofficial-lang/apay Checked 2 days ago Published 2 months ago

Universal HTTP 402 Micropayment Protocol & Autonomous Economic Settlement Engine for AI Agents

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

apay_request

Make an HTTP request (GET, POST, etc.) to any API or website. If the endpoint returns an HTTP 402 Payment Required challenge, A-Pay automatically signs the cryptographic payment authorization within your budget limits and unlocks the data in <25ms.

ParameterTypeDescription
url *stringTarget endpoint URL to fetch or query
headersobjectOptional additional HTTP headers
json_bodyobjectOptional JSON payload for POST/PUT requests
methodstringHTTP request method (default: GET)

apay_get_wallet_status

Inspect the agent's active non-custodial wallet address, current spending guardrails, and total spent in USDC and $APAY.

apay_set_budget

Configure agent safety invariants and spending guardrails. Prevents runaway loops or overcharging.

ParameterTypeDescription
daily_budget_apaynumberMaximum $APAY token rolling 24-hour spending budget
daily_budget_usdcnumberMaximum USDC rolling 24-hour spending budget
max_per_call_apaynumberMaximum $APAY token allowance for a single API call
max_per_call_usdcnumberMaximum USDC allowance for a single API call

apay_inspect_endpoint

Inspect an endpoint to check if it requires an A-Pay micropayment, inspect the exact price quote, currency, and payout receiver without spending any funds.

ParameterTypeDescription
url *stringThe URL to probe for HTTP 402 payment requirements

apay_get_balance

Inspect the agent's live on-chain balances on Base Layer 2, including native ETH (for gas), USDC, and $APAY tokens.