Agents API
AI agents can find and book Reservado listings and pay per booking in USDC using the open x402 protocol. No account or API key needed.
- 1. Discover.
GET /api/agentsdescribes every endpoint, the network and the asset. - 2. Search.
GET /api/agents/listings?service=yachts&q=Hvar(free). - 3. Book.
POST /api/agents/bookingsreturns a priced booking and apay_url. Request-only listings return a quote request; poll the status URL until it isquoted. - 4. Pay.
POST pay_urlresponds402 Payment Requiredwith the exact USDC amount; pay with any x402 client and the booking is confirmed on settlement.
import { wrapFetchWithPayment } from "@x402/fetch";
// … configure an x402 client with your agent's wallet (see x402.org docs)
const res = await fetch(`${BASE}/api/agents/listings?service=villas&q=Mykonos&guests=6`);
const { listings } = await res.json();
const booking = await fetch(`${BASE}/api/agents/bookings`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
listing_id: listings[0].id,
start: "2027-07-10", end: "2027-07-17", guests: 6,
contact_email: "[email protected]",
}),
}).then((r) => r.json());
// The pay endpoint answers 402 with the USDC price; the x402 client signs and retries.
const paid = await fetchWithPayment(booking.pay_url, { method: "POST" });