# prefix.domains > Domain registrar API for AI agents. Register names for your principal, then manage DNS, TXT records, nameservers, renewals, and settings over HTTP, paid from a card your principal saves once. Names are registered through Name.com (ICANN-accredited); your principal is the registrant. Start here: POST /v1/signup → POST /v1/names/quote → confirm the price with your principal → POST /v1/registrations. The first order returns 402 with `checkout_url`: your principal pays it, which places the order and saves their card; later orders charge that card automatically. Details below under "Direct registration flow". Canonical host: **https://prefix.domains** Legacy host **suffix.agency** redirects here. ## What you should know - Two ways to buy. (1) Direct registration (recommended; account key required): POST /v1/registrations registers the name with your principal as registrant, paid from account credit or the saved card; you then manage it here. (2) Purchase plans: the domain registers into your principal's own account at another registrar and they pay that registrar. - Purchase plans assume a cold start: create account or log in, verify email, add payment, then buy. They do not assume you already have registrar API keys. - Each purchase-plan response lists `prerequisites` up front (email, card, registrant contact, etc.) and `steps` that may branch with `when` (e.g. `account.exists == false` vs `true`). - Read `validation` on every purchase-plan. `live_register_proven` is false unless a live register has been proven. Prefer `harness_mock_executed` / `documented_api_mock_tested` over `template_unverified`, and be ready to adapt browser selectors. - Your agent needs: HTTP, browser, email, payment, and secrets storage (SMS only if the registrar requires it). - Availability statuses are definitive only: `taken`, `available`, `unknown`, `invalid`. - `available` always includes a stated register price from a registrar check. `taken` is confirmed via registry lookup. - List prices are standard TLD retail snapshots (`price_class=standard_list`). Premiums require a live quote (`price_class=premium`) plus `accept_premium: true` and matching `accept_price_cents` before a purchase-plan is `ready`. - Default price ranking uses register (year-1) price. Pass `optimize=tco_2y` or `optimize=renew` for other orderings. - MCP: remote server at https://prefix.domains/mcp (streamable HTTP) with the same tools and rules as these routes (search_names, quote_name, register_name, set_txt, ...). It requires sign-in: MCP clients (claude.ai, ChatGPT, Claude Code, Cursor) connect with OAuth, where your principal signs in or creates the account by email code in their browser. Or send an existing key as the connection's `Authorization: Bearer sfx_...` header. Otherwise use OpenAPI: /openapi.json - Price comparison, search, and quotes need no key; expect IP rate limits. Direct registration, account, and DNS routes need `Authorization: Bearer sfx_...`. - Getting a key: POST /v1/signup {email, contact, agent_name} returns `api_key` (shown once). `contact` is your principal (the person or org you act for); they are the registrant of every name on the account. `agent_name` labels your key (e.g. "Otherwise on MacBook"). Do not ask your principal to set up payment yet; the first order does it. - Remembering the key: store `api_key` in your secrets store or a gitignored env file, never in chat or memory notes. Losing it is recoverable, so do not ask your principal to back it up. - Signing in (lost key, new machine, or signup said `account_exists`): POST /v1/auth/login {email, agent_name} emails a 6-digit code to the account address and returns `login_id` (unknown emails get the same 202 but no email: if none arrives, the address has no account, so POST /v1/signup). Ask your principal for the code (or read it yourself if they gave you that inbox), then POST /v1/auth/login/verify {login_id, code} → new `api_key`. Codes expire in 15 minutes; 5 wrong tries end the sign-in; 5 codes per account per hour. POST /v1/signup on an existing email starts this for you: 409 `account_exists` with `login_id`. No passwords exist; never ask for one. - Keys: each agent gets its own key. GET /v1/account/keys lists them (label, last_used_at, `current`); DELETE /v1/account/keys/{id} revokes one, e.g. when your principal asks to cut off an old agent. - Direct registration flow: POST /v1/names/search → POST /v1/names/quote {domain, years} → POST /v1/registrations {domain, years, accept_price_cents = quote price_cents, idempotency_key}. Reuse the same idempotency_key on retry; it never charges twice. 202 = settling, poll GET /v1/registrations/{id}. Failures are refunded: the part paid by card goes back to the card, the rest to account credit (see `refund` on the registration). - Paying the first order: with no saved card, POST /v1/registrations returns 402 `payment_required` with `checkout_url` (a short https://prefix.domains/pay/… link that never expires). Send it to your principal as is, saying what it buys, e.g. "Pay $14.99 to register tomcs.dev: ". The page shows the name and price; paying it registers the name and saves the card for later orders within the account limits. Meanwhile retry the same request (same idempotency_key) every 5-10 seconds: it keeps returning 402 with the same link until paid, then the registration. If the name can no longer be placed after payment (taken, price changed), the payment is refunded to the card and the retry tells you why. `checkout.amount_cents` is what the card is charged; account credit covers the rest. (`payment_setup_url` from signup or POST /v1/account/payment-setup saves a card without buying anything.) - Renewing: GET /v1/domains/{domain}/renewal-quote?years=1 → POST /v1/domains/{domain}/renewals {years, accept_price_cents = quote price_cents, idempotency_key}. Same payment, refund, and 202 rules as registration; poll GET /v1/renewals/{id}. Or PATCH /v1/domains/{domain} {auto_renew: true} to renew 1 year automatically before expiry using credit or the saved card. - Check GET /v1/account `attention` regularly: it lists names whose contact is unverified, whose auto-renew is failing, or that expire within 30 days without auto-renew. - Limits (see GET /v1/account `limits`): max price per name, spend (registrations + renewals) and registrations per rolling 24h, DNS writes per hour. Over a limit → 403 `limit_exceeded`. Brand look-alike and `xn--` names are refused (`name_blocked`). - Your registrant email will receive a contact verification message; verify it within 15 days or the name can stop resolving. GET /v1/domains/{domain} shows `contact_verification` and `verify_by`; POST /v1/domains/{domain}/contact-verification/resend sends the email again. - Settings: PATCH /v1/domains/{domain} {locked, privacy, auto_renew}. Unlock, then POST /v1/domains/{domain}/auth-code to email your principal an approval code, and POST /v1/domains/{domain}/auth-code/verify {approval_id, code} → `auth_code` to transfer away (an API key alone never gets it; same limits as sign-in codes); new names cannot be unlocked for 60 days (409 `registrar_refused` gives the date). PUT /v1/domains/{domain}/nameservers {nameservers} to use other DNS (the DNS routes below then stop affecting resolution). - TXT records by host (simplest): PUT /v1/domains/{domain}/txt {host, values} sets exactly those values; POST {host, value} adds one; DELETE ?host=&value= removes; GET ?host= reads. host "" or "@" is the apex. Use these for verification tokens. - Other DNS: GET/POST /v1/domains/{domain}/records, PUT/DELETE /v1/domains/{domain}/records/{id}. Types A, AAAA, ANAME, CNAME, MX, NS, SRV, TXT; ttl ≥ 300; host "" or "@" is the apex; PUT replaces the whole record. - Every DNS response includes `dns_active`. If it is false, the name uses outside nameservers (listed in `nameservers`) and your change will not take effect: tell your principal what `warning` says and edit DNS at that provider, or PUT the nameservers back to Name.com's. Don't report a DNS change as done while `dns_active` is false. ## Endpoints - GET /v1/registrars - GET /v1/prices?tld= - GET /v1/compare?domain=&optimize=register|tco_2y|renew - POST /v1/availability - POST /v1/quote - POST /v1/purchase-plan - POST /v1/suggest - POST /v1/names/search - POST /v1/names/quote - POST /v1/signup - POST /v1/auth/login - POST /v1/auth/login/verify - GET /v1/account - GET /v1/account/keys - DELETE /v1/account/keys/{id} - POST /v1/account/payment-setup - POST /v1/registrations - GET /v1/registrations/{id} - GET /v1/domains - GET|PATCH /v1/domains/{domain} - GET /v1/domains/{domain}/renewal-quote - GET|POST /v1/domains/{domain}/renewals - GET /v1/renewals/{id} - PUT /v1/domains/{domain}/nameservers - POST /v1/domains/{domain}/contact-verification/resend - POST /v1/domains/{domain}/auth-code - POST /v1/domains/{domain}/auth-code/verify - GET|POST /v1/domains/{domain}/records - PUT|DELETE /v1/domains/{domain}/records/{id} - GET|PUT|POST|DELETE /v1/domains/{domain}/txt - GET /v1/health - GET /llms.txt - GET /openapi.json