#!/usr/bin/env bash # Free sample + unpaid HTTP 402 against the live AestheticData API. # No wallet and no payment. Safe to run. set -euo pipefail BASE="https://api.aestheticdata.io" echo "== Free sample (no payment) ==" curl -sS "$BASE/sample" | python3 -m json.tool | head -n 40 echo echo "== Unpaid GET /x402/brands (expect HTTP 402) ==" tmp="$(mktemp)" hdr="$(mktemp)" code="$(curl -sS -D "$hdr" -o "$tmp" -w "%{http_code}" "$BASE/x402/brands")" echo "HTTP $code" # Show status and payment-related headers only. awk 'BEGIN{IGNORECASE=1} /^HTTP\// || /^[Cc]ontent-[Tt]ype:/ || /[Pp]ayment/ {print}' "$hdr" echo echo "The v2 challenge is the PAYMENT-REQUIRED header (Base64)." echo "Atomic amount 1000 = 0.001 USDC. Do not send a bare transaction hash." echo "To pay, retry the same request with PAYMENT-SIGNATURE (see the TypeScript snippet)."