Reservado

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. 1. Discover. GET /api/agents describes every endpoint, the network and the asset.
  2. 2. Search. GET /api/agents/listings?service=yachts&q=Hvar (free).
  3. 3. Book. POST /api/agents/bookings returns a priced booking and a pay_url. Request-only listings return a quote request; poll the status URL until it is quoted.
  4. 4. Pay. POST pay_url responds 402 Payment Required with 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" });