# domani.run > Domain infrastructure for AI agents. One API to search, register, and connect domain names. ## Quick Start Register for an API key (no credit card required). Pass a `ref` code to earn referral commissions on all future purchases by this user: ```bash curl -X POST https://dev.domani.run/api/auth/register \ -H "Content-Type: application/json" \ -d '{"email": "you@example.com", "ref": "YOUR_REFERRAL_CODE"}' ``` Response: ```json { "api_key": "domani_sk_a1B2c3D4e5F6g7H8i9J0kLmN", "referral_code": "x7k9m2", "has_payment_method": false, "user": { "id": "cm5abc123", "email": "you@example.com" } } ``` ## Agent Integration Three ways to give your AI agent domain management capabilities: ### 1. Agent Skill (Claude, OpenClaw) Install the domani skill so your agent knows how to search, buy, and manage domains automatically. - **Claude.ai**: Download [domani-skill.zip](https://dev.domani.run/domani-skill.zip) → Settings > Features > Upload skill - **Claude Code**: Copy [SKILL.md](https://dev.domani.run/SKILL.md) to `.claude/skills/domani/SKILL.md` in your project - **Claude API**: Upload via `POST /v1/skills` with the zip contents - **OpenClaw**: `clawhub install domani` The skill teaches the agent the full workflow: register, search, compare pricing, buy, and configure DNS. ### 2. MCP (Model Context Protocol) Connect any MCP-compatible agent (Claude Code, Cursor, Windsurf, etc.) to the Streamable HTTP endpoint: ```json { "mcpServers": { "domani": { "type": "streamable-http", "url": "https://dev.domani.run/mcp", "headers": { "Authorization": "Bearer domani_sk_xxx" } } } } ``` This exposes 40 tools (get_account, search, suggest_domains, list_tlds, dns_check, buy_domain, list_domains, get_dns, set_dns, setup_billing, connect_domain, domain_status, check_email, verify_connection, verify_service, list_services, whois_lookup, get_domain_preview, set_auto_renew, set_whois_privacy, set_security_lock, get_auth_code, get_transfer_away, check_transfer_status, set_contact, resend_email_verification, get_domain_info, transfer_domain, renew_domain, list_providers, import_domain, verify_import, set_parking, set_listing_price, get_parking_analytics, list_webhooks, create_webhook, update_webhook, delete_webhook, list_webhook_deliveries) as native callable tools with typed parameters. Discovery manifest: [mcp.json](https://dev.domani.run/.well-known/mcp.json) ### 3. Direct API Use the REST API directly with `curl`, `fetch`, or any HTTP client. See the [OpenAPI spec](https://dev.domani.run/.well-known/openapi.json) for the full schema, or the [interactive docs](https://dev.domani.run/docs) to try endpoints in the browser. ## Authentication Most API endpoints require a Bearer token: ``` Authorization: Bearer domani_sk_xxx ``` API keys use the prefix `domani_sk_` followed by 32 random characters. You can create multiple tokens via `POST /api/tokens` for different applications. **Public endpoints** (no authentication required): - `GET /api/domains/search` - Check availability and pricing (single via `?q=`, multi via `?domains=`, SSE via `Accept: text/event-stream`). SSE is cancellable - closing the connection aborts in-flight RDAP lookups. - `GET /api/tlds` - List all TLDs with pricing - `GET /api/domains/whois` - WHOIS/RDAP lookup - `GET /api/domains/{domain}/og` - Website preview metadata (title, description, image, favicon) - `GET /api/domains/suggest` - AI domain name suggestions. Optional: `tlds` (comma-separated preferred TLDs), `style` (single|creative|short|brandable|keyword), `lang` (japanese|spanish|french|italian|latin|nordic|arabic|sanskrit). SSE is cancellable - closing the connection aborts in-flight LLM generation and RDAP lookups. These endpoints use IP-based rate limiting. Authenticated requests get higher rate limits. ## Agent Workflow Recommended sequence for finding and buying a domain: 1. **Check account**: `GET /api/me` - verify authentication, check `has_payment_method` and `has_contact` 1b. **Set contact info** (one-time): If `has_contact` is false, set WHOIS registrant contact before buying: `PUT /api/me/contact` with `{"first_name":"...","last_name":"...","address1":"...","city":"...","state":"...","postal_code":"...","country":"US","phone":"+1.5551234567","email":"..."}`. Required by ICANN for domain registration. When updated, the new contact is automatically propagated to all active domains at supported registrars. 2. **Get name ideas**: `GET /api/domains/suggest?prompt=AI+coding+assistant&tlds=com,dev&style=short` - AI-generated domain names with availability (10/min). Optional filters: `tlds` (preferred TLDs), `style` (single|creative|short|brandable|keyword), `lang` (japanese|spanish|french|...) 3. **Browse TLDs**: `GET /api/tlds?max_price=20&sort=price` - list available TLDs with pricing 4. **Search domains**: `GET /api/domains/search?domains=myproject.com,myproject.dev,myproject.ai` - check availability and pricing across TLDs via RDAP (max 200 domains, 20/min). For a single domain: `GET /api/domains/search?q=myproject.dev`. For real-time streaming: add `Accept: text/event-stream` header. 5. **Purchase**: `POST /api/domains/buy` with `{"domain": "myproject.dev", "payment_method": "card"}` for single or `{"domains": ["myproject.dev", "myproject.com"]}` for bulk (max 10). Each domain is processed independently - failures don't block other purchases. Optional `years` (1-10, default 1) to register for multiple years - price is multiplied by years. Optional `payment_method`: `"card"` (charge card) or `"usdc"` (returns 402 with payment instructions). For USDC: first call returns 402 with `payment_options.crypto` (wallet, amount, chains), send USDC, then retry with `payment_tx` (tx hash) and `payment_chain` ("base" or "ethereum"). If omitted, uses the user's `preferred_payment_method` (set via `PUT /api/me`), or auto-selects (card if available, else 402). Bulk purchases require card. 6. **Connect**: `POST /api/domains/myproject.dev/connect` with `{"target": "my-app.vercel.app"}` - auto-detects provider and sets DNS records. Or use `{"provider": "google-workspace"}` for email. For imported domains (registrar=external), returns the records as instructions with `status: "manual_setup_required"` instead of writing them - the user adds records at their registrar manually. 7. **Set up email**: `POST /api/domains/myproject.dev/connect` with `{"provider": "google"}` - shorthand for email setup. Sets MX, SPF, DMARC records. Shorthand names: `google` (Google Workspace), `proton` (Proton Mail), `fastmail` (Fastmail). 8. **Check email health**: `GET /api/domains/myproject.dev/email/check` - verifies MX propagation, SPF, DMARC, DKIM. Auto-detects the email provider from MX records. 9. **Verify**: `POST /api/domains/myproject.dev/verify` with `{"target": "my-app.vercel.app"}` - confirms DNS propagation 10. **Verify service**: `POST /api/domains/myproject.dev/verify-service` with `{"service": "stripe", "token": "xxx"}` - adds verification DNS records for Stripe, Google Search Console, AWS SES, etc. 11. **Check status**: `GET /api/domains/myproject.dev/status` - DNS, SSL, email, and expiry health check 12. **WHOIS / RDAP lookup**: `GET /api/domains/whois?q=example.com` - look up full registration data for any domain: registrar (name, URL, IANA ID), dates (created, expires, updated, days_until_expiry), status codes, nameservers, DNSSEC, privacy redaction status, and contacts (registrant, admin, tech, billing, abuse - each with name, organization, email, phone, address). Uses RDAP with automatic WHOIS port 43 fallback. Cached 1h (registered) / 5min (not-found). Rate limit: 30/min 13. **Domain info**: `GET /api/domains/myproject.dev` - get detailed info about a domain you own: status, auto-renew, parking_enabled, listing_price, purchase/expiry dates, days until expiry, payment method, and registrar-side data (security lock, WHOIS privacy, auto-renew status, creation/expiration dates). Rate limit: 60/min 14. **Domain settings**: `PUT /api/domains/myproject.dev/settings` with `{"auto_renew": false}`, `{"whois_privacy": true}`, and/or `{"security_lock": false}` - toggle auto-renew, WHOIS privacy, and security lock. Applied at registrar first, then synced to local DB. WHOIS privacy and security lock are enabled by default on new registrations. Rate limit: 60/min 14b. **Get auth code** (transfer away): `GET /api/domains/myproject.dev/auth-code` - get the EPP auth code to transfer a domain to another registrar. Automatically unlocks the domain if locked. Returns `auth_code`, `was_unlocked`, and `next_steps`. Give the auth code to the new registrar to initiate the transfer. Rate limit: 10/min 14c. **Transfer away status**: `GET /api/domains/myproject.dev/transfer-away` - check status of an outbound domain transfer. Returns `status` (none|pending|approved|completed|rejected|expired), `gaining_registrar`, `request_date`. Rate limit: 30/min 14d. **Parking**: `PUT /api/domains/myproject.dev/parking` with `{"enabled": true}` - enable or disable the parking page. When enabled, visitors see a branded parking page. If the domain has existing DNS records, the API returns 409 with `requires_confirmation: true` and `existing_dns` listing the records that will be overwritten - call again with `{"enabled": true, "confirm": true}` to proceed. Newly purchased domains are parked by default. 14e. **Listing price**: `PUT /api/domains/myproject.dev/parking` with `{"listing_price": 499.99}` - set a "For Sale" price. Visitors see a "For Sale" page with a contact form to reach the owner. Set `{"listing_price": null}` to remove the listing. Rate limit: 60/min 14f. **Parking analytics**: `GET /api/domains/myproject.dev/analytics` - get visitor analytics for a parked domain: `views_7d`, `views_30d`, `inquiries_30d`, `conversion_rate`, `daily_views` (30-day breakdown by date), and `recent_inquiries` (last 5 with email, offer, date). Rate limit: 60/min 14g. **Webhooks**: Register HTTPS endpoints to receive real-time event notifications. `POST /api/webhooks` with `{"url":"https://example.com/hook","events":["domain.purchased","dns.updated"]}` - returns `id`, `url`, `events`, `secret` (shown once), `active`. Verify payloads with the `X-Domani-Signature` header (`t=timestamp,v1=hmac-sha256`). Events: `domain.purchased`, `domain.renewed`, `domain.expiring`, `dns.updated`, `transfer.initiated`, `transfer.completed`, `transfer.failed`, `inquiry.received`, `parking.updated`. Max 5 per account, HTTPS only. Failed deliveries retried 3x with backoff. Manage: `GET /api/webhooks` (list), `PATCH /api/webhooks/{id}` (update), `DELETE /api/webhooks/{id}` (delete), `GET /api/webhooks/{id}/deliveries` (delivery history), `GET /api/webhooks/events` (list event types, public). Rate limit: 60/min 15. **Renew domain**: `POST /api/domains/myproject.dev/renew` with `{"years": 1}` - extend registration by 1-10 years. Optional `payment_method`: `"card"` or `"usdc"`. Payment charged upfront. Returns new expiry date. Rate limit: 10/min **Bring an existing domain**: Two options - **import** (free, read-only monitoring, domain stays at current registrar) or **transfer** (paid - includes 1 year renewal, full migration with EPP code, domain moves to domani.run). Always check transfer price via `GET /api/tlds` and confirm with the user before initiating. 16. **Import an existing domain** (free): `POST /api/domains/import` with `{"domain": "mysite.com"}` → returns a TXT record to add at your DNS provider. After adding the record, call `POST /api/domains/import/verify` with `{"domain": "mysite.com"}` to complete. Then use `POST /api/domains/mysite.com/connect` with `{"target": "my-app.vercel.app"}` to get the exact DNS records to add at your registrar (`status: "manual_setup_required"`). Verify with `POST /api/domains/mysite.com/verify`. No lock-in - domain stays at your current registrar. Rate limit: 30/min (initiate), 10/min (verify) 17. **Transfer domain** (full migration, paid): `POST /api/domains/transfer` with `{"domain": "example.com", "auth_code": "EPP-CODE", "payment_method": "card"}` - transfer a domain from another registrar. **Paid** - the transfer price includes 1 year of renewal (check price via `GET /api/tlds?search=TLD`, use the `transfer` field). Always show the price and get user confirmation before calling. Requires authorization/EPP code from your current registrar. Domain moves to domani.run with full DNS, renewal, and auto-renew control. Returns 202 (async, takes 1-5 days). Rate limit: 5/min **Before transferring**: The user must (1) unlock the domain at their current registrar, (2) get the EPP/auth code, and (3) optionally disable WHOIS privacy. Common registrar paths: GoDaddy (Domain Settings → Transfer away), Namecheap (Sharing & Transfer → Transfer Out → Unlock → Auth Code), Cloudflare (Configuration → Authorization Code), Squarespace (Settings → Transfer away → Get auth code). If the domain was registered or transferred less than 60 days ago, ICANN rules prevent transfer. **If the domain is not yet eligible**, the API returns the eligibility date and we automatically email the user when it becomes eligible - they'll need a fresh EPP code at that time. No payment is charged until the transfer actually goes through. 17b. **Check transfer status**: `GET /api/domains/example.com/transfer-status` - check inbound transfer progress. Returns detailed status (`pending_owner`, `pending_admin`, `pending_registry`, `completed`, `cancelled`) with actionable hints. Rate limit: 30/min ### Example: Search and Buy ```bash # Step 1: Compare pricing across TLDs (no auth needed) curl "https://dev.domani.run/api/domains/search?domains=myproject.com,myproject.dev,myproject.xyz,myproject.ai&max_price=20" # Step 2: Buy the cheapest available option curl -X POST https://dev.domani.run/api/domains/buy \ -H "Authorization: Bearer domani_sk_xxx" \ -H "Content-Type: application/json" \ -d '{"domain": "myproject.xyz"}' # Step 3: Connect to your hosting provider (auto-detects Vercel) # The response includes a next_steps array with provider-specific actions # (e.g., add the domain in Vercel dashboard). Always present these to the user. # Some providers (cloudflare-pages, github-pages, railway, fly) require a target # parameter - use GET /api/domains/{domain}/connect to check requires_target first. curl -X POST https://dev.domani.run/api/domains/myproject.xyz/connect \ -H "Authorization: Bearer domani_sk_xxx" \ -H "Content-Type: application/json" \ -d '{"target": "my-app.vercel.app"}' # Step 4: Verify the connection is live curl -X POST https://dev.domani.run/api/domains/myproject.xyz/verify \ -H "Authorization: Bearer domani_sk_xxx" \ -H "Content-Type: application/json" \ -d '{"target": "my-app.vercel.app"}' # Step 5: Verify domain for Stripe curl -X POST https://dev.domani.run/api/domains/myproject.xyz/verify-service \ -H "Authorization: Bearer domani_sk_xxx" \ -H "Content-Type: application/json" \ -d '{"service": "stripe", "token": "abc123def456"}' # Step 6: Check overall domain health curl https://dev.domani.run/api/domains/myproject.xyz/status \ -H "Authorization: Bearer domani_sk_xxx" ``` ### Example: Bulk Buy ```bash # Buy multiple domains at once (requires card on file) curl -X POST https://dev.domani.run/api/domains/buy \ -H "Authorization: Bearer domani_sk_xxx" \ -H "Content-Type: application/json" \ -d '{"domains": ["myproject.com", "myproject.dev", "myproject.ai"]}' ``` Response (partial success): ```json { "results": [ {"domain": "myproject.com", "status": "active", "price": 10.88, "currency": "USD", "payment_method": "card"}, {"domain": "myproject.dev", "status": "active", "price": 14.88, "currency": "USD", "payment_method": "card"} ], "errors": [ {"domain": "myproject.ai", "error": "Domain is not available", "code": "DOMAIN_UNAVAILABLE"} ], "summary": {"total": 3, "succeeded": 2, "failed": 1} } ``` ## Endpoints | Method | Path | Description | |--------|------|-------------| | `POST` | `/api/auth/register` | Create account and get API key | | `POST` | `/api/auth/login` | Send magic link sign-in email | | `GET` | `/api/me` | Get account details (email, payment status, preferred payment method, referral code) | | `PUT` | `/api/me` | Update account preferences (`preferred_payment_method`: "card", "usdc", or null) | | `DELETE` | `/api/me` | Delete account and all associated data | | `GET` | `/api/me/contact` | Get WHOIS contact info | | `PUT` | `/api/me/contact` | Set WHOIS contact info (required before purchasing) | | `GET` | `/api/tlds` | List all TLDs with pricing (public, no auth required) | | `GET` | `/api/domains/search` | Check domain availability and pricing - single (`?q=`), multi (`?domains=`), SSE (`Accept: text/event-stream`, cancellable) (public) | | `GET` | `/api/domains/suggest?prompt=description` | AI domain name suggestions (public). Optional: `tlds`, `style` (single/creative/short/brandable/keyword), `lang` (japanese/spanish/french/...) | | `POST` | `/api/domains/buy` | Purchase one or more domains (single: `{domain}`, bulk: `{domains:[...]}`, max 10) | | `POST` | `/api/domains/import` | Import a domain you own elsewhere (free) | | `POST` | `/api/domains/import/verify` | Verify DNS ownership and complete import | | `POST` | `/api/domains/transfer` | Transfer domain from another registrar | | `GET` | `/api/domains/{domain}/transfer-status` | Check inbound transfer status | | `POST` | `/api/domains/{domain}/renew` | Renew domain for additional years | | `GET` | `/api/domains` | List your registered domains | | `GET` | `/api/domains/{domain}/dns` | Get DNS records | | `PUT` | `/api/domains/{domain}/dns` | Set DNS records | | `POST` | `/api/domains/{domain}/connect` | Connect to a provider (auto-detect or explicit) | | `GET` | `/api/domains/{domain}/connect` | List available providers and methods | | `POST` | `/api/domains/{domain}/verify` | Verify provider connection is live | | `POST` | `/api/domains/{domain}/verify-service` | Add verification DNS records for a service (Stripe, Google, etc.) | | `GET` | `/api/domains/{domain}/verify-service` | List supported verification services | | `GET` | `/api/domains/{domain}` | Get domain details | | `PUT` | `/api/domains/{domain}/settings` | Update domain settings (auto-renew, WHOIS privacy, security lock) | | `GET` | `/api/domains/{domain}/auth-code` | Get EPP auth code for transferring away (auto-unlocks) | | `GET` | `/api/domains/{domain}/transfer-away` | Check outbound transfer status | | `GET` | `/api/domains/{domain}/email/check` | Email health: MX, SPF, DMARC, DKIM | | `GET` | `/api/domains/{domain}/status` | Domain health: DNS, SSL, email, expiry | | `GET` | `/api/domains/whois?q=example.com` | RDAP/WHOIS lookup (public, no auth required) | | `GET` | `/api/domains/{domain}/og` | Website preview metadata: title, description, image, favicon (public) | | `POST` | `/api/billing/setup` | Add payment method (card) | | `GET` | `/api/tokens` | List API tokens | | `POST` | `/api/tokens` | Create API token | | `DELETE` | `/api/tokens/{id}` | Revoke API token | | `GET` | `/api/referrals` | View referral earnings | | `POST` | `/api/referrals/request-payout` | Request payout of pending referral earnings | | `PUT` | `/api/domains/{domain}/parking` | Enable/disable parking page and set listing price | | `GET` | `/api/domains/{domain}/analytics` | Parking analytics: views (7d/30d), inquiries, conversion rate, daily breakdown, recent inquiries | | `GET` | `/api/cart` | List cart items | | `POST` | `/api/cart` | Add domain to cart | | `DELETE` | `/api/cart` | Remove domain from cart | | `GET` | `/api/webhooks` | List webhook endpoints | | `POST` | `/api/webhooks` | Create webhook (returns secret once) | | `PATCH` | `/api/webhooks/{id}` | Update webhook (URL, events, active) | | `DELETE` | `/api/webhooks/{id}` | Delete webhook | | `GET` | `/api/webhooks/{id}/deliveries` | Delivery history for a webhook | | `GET` | `/api/webhooks/events` | List available event types (public) | | `GET` | `/api/domains/dns-check` | Fast DNS-based domain existence check (public) | ## Rate Limits All responses include rate limit headers: - `X-RateLimit-Limit` - Maximum requests allowed per window - `X-RateLimit-Remaining` - Requests remaining in current window - `X-RateLimit-Reset` - Unix timestamp when the window resets | Endpoint | Public Limit | Auth Limit | Notes | |----------|-------------|------------|-------| | `GET /api/domains/search` | 20/min (IP) | 60/min (user) | Availability + pricing (single, multi, SSE) | | `GET /api/tlds` | 30/min (IP) | 60/min (user) | TLD listing | | `GET /api/domains/suggest` | 10/min (IP) | 10/min (IP) | AI-generated domain names | | `GET /api/domains/whois` | 10/min (IP) | 30/min (user) | Cached 1h registered, 5min not-found | | `GET /api/domains/{domain}/og` | 30/min (IP) | 30/min (IP) | Cached 7 days, CDN 24h | | `GET /api/domains/{domain}` | - | 60/min (user) | Auth required | | `PUT /api/domains/{domain}/settings` | - | 60/min (user) | Auth required | | `POST /api/domains/buy` | - | 10/min (user) | Auth required | | `POST /api/domains/import` | - | 30/min (user) | Auth required | | `POST /api/domains/import/verify` | - | 10/min (user) | Auth required, DNS lookup | | `POST /api/domains/transfer` | - | 5/min (user) | Auth required, async (1-5 days) | | `GET /api/domains/{domain}/transfer-status` | - | 30/min (user) | Auth required, inbound transfer status | | `GET /api/domains/{domain}/auth-code` | - | 10/min (user) | Auth required, auto-unlocks domain | | `GET /api/domains/{domain}/transfer-away` | - | 30/min (user) | Auth required | | `POST /api/domains/{domain}/renew` | - | 10/min (user) | Auth required | | `POST /api/auth/register` | 5/min (IP) | - | | | `POST /api/auth/login` | 10/min (IP) | - | | | All other authenticated | - | 60/min (user) | Per endpoint | When rate limited (HTTP 429), the response includes a `Retry-After` header with seconds to wait. Recommended strategy: exponential backoff starting at the `Retry-After` value. ## Error Format All errors return a consistent JSON envelope: ```json { "error": "Human-readable message", "code": "MACHINE_CODE", "hint": "Actionable recovery guidance", "documentation_url": "https://dev.domani.run/llms.txt" } ``` ### Error Codes | Code | HTTP | Meaning | Recovery | |------|------|---------|----------| | `MISSING_API_KEY` | 401 | No Authorization header | Add `Authorization: Bearer domani_sk_xxx` header | | `INVALID_API_KEY` | 401 | Key not found or revoked | Check key or create a new one via `POST /api/tokens` | | `MISSING_PARAMETER` | 400 | Required field missing | Check `hint` field for the missing parameter | | `INVALID_DOMAIN` | 400 | Bad domain format | Use format `name.tld` (e.g. `mysite.com`) | | `PAYMENT_REQUIRED` | 402 | No payment method | Pay with USDC via x402 (automatic) or add a card via `POST /api/billing/setup` | | `DOMAIN_UNAVAILABLE` | 409 | Domain is taken | Try a different domain or TLD | | `RATE_LIMIT_EXCEEDED` | 429 | Too many requests | Wait `retry_after` seconds, then retry | | `USER_EXISTS` | 409 | Email already registered | Use `POST /api/auth/login` instead | | `NOT_FOUND` | 404 | Resource not found | Verify the ID/domain exists and belongs to you | | `NOT_AVAILABLE` | 501 | Feature not available | The requested feature is not supported by the current registrar (Preview - coming soon) | ## Referral Program Agents and integrations can earn commissions on domain purchases: 1. **Register** with `POST /api/auth/register` to get your `referral_code` 2. **Link users** by passing your code as `ref` when registering new users: `{"email": "...", "ref": "YOUR_CODE"}` 3. **Earn automatically** - every domain purchased by a user you referred earns you a 20% commission on the markup, permanently The referral link is set once at registration and applies to all future purchases. No need to pass the code on every buy request. Check your earnings with `GET /api/referrals`. ## Paying with USDC No credit card needed. Two-step flow: 1. `POST /api/domains/buy` with `{"domain": "mysite.com", "payment_method": "usdc"}` - returns 402 with wallet address, USDC amount, and supported chains (Base or Ethereum) in `payment_options.crypto`. 2. Send USDC to the provided address, then retry: `POST /api/domains/buy` with `{"domain": "mysite.com", "payment_tx": "0xabc...", "payment_chain": "base"}`. The server verifies the transaction on-chain and completes registration. Each tx hash can only be used once. Works for single domain purchases. **Supported chains**: Base (chain_id 8453), Ethereum Mainnet (chain_id 1). **Asset**: USDC. ### Automatic payments with x402 For agents with their own crypto wallet, the API supports the [x402 protocol](https://x402.org) for fully automatic USDC payments - no manual transfer needed. Setup: `npm install @x402/fetch`, create a wallet funded with USDC on Base, then wrap your fetch: ```typescript import { wrapFetch } from "@x402/fetch"; const x402Fetch = wrapFetch(fetch, walletClient); // walletClient = viem wallet with USDC on Base const res = await x402Fetch("https://dev.domani.run/api/domains/buy", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ domain: "mysite.com" }), }); ``` Every API call that requires payment is handled automatically via `PAYMENT-REQUIRED` / `PAYMENT-SIGNATURE` / `PAYMENT-RESPONSE` headers. ## Pagination The `GET /api/tlds` endpoint supports pagination via `limit` and `offset` query parameters. When more results exist, the response includes a `Link` header: ``` Link: ; rel="next" ```