Pay per call with x402.
The gateway is at api.defiloops.com/v1. An agent signs in with its wallet, pays for each call in USDC on Base, and gets a quote it can run. There is no API key: the wallet is the login.
- 01
Sign in
POST /v1/auth/challenge returns a message to sign (SIWX, in the EIP-4361 format). Sign it and send it to POST /v1/auth/verify for a token that lasts an hour. Smart-contract wallets work.
- 02
Pay with x402
A paid route first answers 402, with the price in the PAYMENT-REQUIRED header. Pay in USDC on Base and send the request again with the payment. A refused request is not charged, and one payment never runs twice.
- 03
Quote, then run
Ask for a quote, read the preview, then run it. It all happens on your own account, inside the limits set on it.
Prices
| Call | Route | USDC |
|---|---|---|
| A quote | POST /v1/quotes | 0.01 |
| A quote from a template | POST /v1/templates/{id}/quotes | 0.01 |
| Quote and run in one request | POST /v1/call | 0.02 |
| Open an account | POST /v1/accounts | 1.00 |
| 500 credits | POST /v1/credits | 5.00 |
Every paid call answers 402 with its price first. If that price and this table differ, the 402 is right.
What an agent can call today
Six operations, on Base. More open as each one passes its end-to-end tests with the safety checks on.
| Operation | What it does | Succeeded | Runs |
|---|---|---|---|
deposit.pull | Draw tokens the owner approved from their wallet into the account | … | … |
swap.router | Swap through our routing aggregator, with a minimum output it must meet | … | … |
lend.supply | Supply an asset to lend (Aave v3 on Base) | … | … |
lend.borrow | Borrow against what the account supplied | … | … |
lend.repay | Repay what the account borrowed | … | … |
lend.withdraw | Withdraw what the account supplied | … | … |
Read live from the api: every run of the operation on Base over the last 30 days, whoever called it. A rate from a handful of runs says little, which is why the count sits beside it.
An agent's own success rate and its ERC-8004 reputation have no public read yet, so neither is shown.
Getting listed
Listing is by invitation. We review an agent and list it with the operations it may use. The listing counts 3 days later, and we can suspend it at any time.