API Reference

DomainForAgents API

Programmatic domain registration for AI agents. Search, register, and manage domains via REST API.

MCP Server

The fastest way to integrate. If your agent supports Model Context Protocol, install our MCP server and get domain tools natively -- no REST calls needed.

Claude Desktop

Add to ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "domainforagents": {
      "command": "npx",
      "args": ["@domainforagents/mcp"],
      "env": {
        "DOMAINFORAGENTS_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Claude Code

claude mcp add domainforagents -- npx @domainforagents/mcp

Any MCP Client

npx @domainforagents/mcp

Set DOMAINFORAGENTS_API_KEY env var. Communicates over stdio.

Available Tools

ToolDescription
create_accountCreate account + get API key (no auth needed)
search_domainsSearch availability and pricing
register_domainRegister a domain
reserve_domainSoft-reserve with payment link
list_domainsList your domains
get_domainGet domain details + DNS
renew_domainRenew a domain
create_dns_recordAdd a DNS record
get_dns_recordsList DNS records
delete_dns_recordRemove a DNS record
set_nameserversSet custom nameservers
get_balanceCheck balance + transactions
get_usdc_deposit_infoGet USDC deposit instructions
create_webhookSubscribe to events
list_webhooksList webhook subscriptions

Don't have an API key yet? The create_account tool works without auth -- your agent can self-onboard.

REST API Quickstart

Get an API key and register your first domain in 3 API calls. No signup form, no browser required.

1. Create an account

curl -X POST https://api.domainforagents.io/api/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{\"name\": \"my-agent\"}'

Returns your api_key and a claim_code for human account access.

2. Search for a domain

curl "https://api.domainforagents.io/api/v1/domains/search?query=myagent" \
  -H "Authorization: Bearer YOUR_API_KEY"

3. Register it

curl -X POST https://api.domainforagents.io/api/v1/domains/register \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{\"name\": \"myagent.io\"}'

Deducts from your prepaid balance. Fund via Stripe or USDC first.

Base URL

https://api.domainforagents.io/api/v1

All endpoints require Authorization: Bearer YOUR_API_KEY unless noted. Responses are JSON. Rate limit: 200 requests/minute.

Authentication

POST /auth/register No auth required

Create an account. Returns an API key immediately. No email required -- agents can start searching and reserving domains instantly.

Request Body

emailstringOptional. Human can add later via claim code.
namestringName for the API key (e.g. "my-agent")

Response

{
  "account_id": "550e8400-e29b-41d4-a716-446655440000",
  "api_key": "dGhpcyBpcyBhIHNhbXBsZSBrZXk...",
  "api_key_prefix": "dGhpcyBp",
  "claim_code": "AGENT-SWIFT-KIWI-7842",
  "sign_in_url": "https://domainforagents.io/claim",
  "balance_cents": 0,
  "created_at": "2026-04-12T00:00:00.000Z"
}

The claim_code lets a human claim the account on the web dashboard to manage billing and settings.

POST /auth/keys

Create an additional API key for the authenticated account.

namestringrequiredA label for this key
GET /auth/keys

List all API keys for the authenticated account. Returns key prefix, name, and last used timestamp. The full key is never shown after creation.

POST /auth/keys/rotate

Invalidates the current API key and returns a new one. Must authenticate with the key being rotated.

POST /domains/suggest Rate limit: 5/min

Generate AI-powered domain name suggestions from a project description. Uses the cheapest available LLM provider. First suggestion is checked for availability, the rest are returned as unchecked suggestions.

Request Body

descriptionstringrequiredProject or idea description (3-150 chars)
curl -X POST https://api.domainforagents.io/api/v1/domains/suggest \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{\"description\": \"online store for vintage cameras\"}'

Response

{
  "results": [
    {
      "domain": "retroshutter.com",
      "available": true,
      "price_usd": 15.14,
      "status": "available"
    },
    {
      "domain": "vintagelens.io",
      "status": "suggestion"
    },
    {
      "domain": "cameravault.dev",
      "status": "suggestion"
    }
  ],
  "provider": "gemini"
}

Results with status suggestion haven't been checked for availability yet. Use GET /domains/search?query=vintagelens.io to verify.

POST /domains/register

Register a domain. Supports three payment methods: prepaid balance, credit card, or crypto (USDC via prepaid balance). Registration is async -- domain state transitions to registering, then registered once confirmed.

Request Body

namestringrequiredDomain to register (e.g. "myagent.io")
yearsintegerRegistration period, default 1
paymentMethodobjectDefault: { "type": "balance" }
dnsRecordsarrayDNS records to set on registration

Pay with balance

curl -X POST https://api.domainforagents.io/api/v1/domains/register \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "myagent.io",
    "paymentMethod": { "type": "balance" }
  }'

Pay with card

curl -X POST https://api.domainforagents.io/api/v1/domains/register \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "myagent.io",
    "paymentMethod": {
      "type": "card",
      "card": {
        "number": "4242424242424242",
        "expMonth": 12,
        "expYear": 2027,
        "cvc": "123"
      },
      "saveCard": true
    }
  }'

Card details are passed directly to Stripe for tokenization. Never stored or logged.

POST /domains/reserve

Soft-reserve a domain. Creates a TTL-based hold (no upstream registration) and returns a Stripe Checkout payment URL. The human or agent can complete payment within the TTL window.

namestringrequiredDomain to reserve
ttlSecondsintegerHold duration (300-21600s). Default: 1h popular TLDs, 6h niche

Response

{
  "reservation_id": "...",
  "domain": "myagent.io",
  "status": "soft_reserved",
  "price_usd": 39.99,
  "expires_at": "2026-04-12T15:00:00.000Z",
  "payment_url": "https://checkout.stripe.com/...",
  "guaranteed": false,
  "note": "Availability not guaranteed. Pay before expiry to register."
}

Max 5 concurrent reservations per account. Expired reservations are automatically released.

GET /domains

List all domains for the authenticated account with pagination and filtering.

pageintegerDefault: 1
limitinteger1-100, default: 20
statestringFilter by state
searchstringSearch by domain name
GET /domains/{id}

Get domain details including state, expiry, DNS records, and registrant info.

POST /domains/{id}/renew

Renew a registered domain. Deducts from prepaid balance.

yearsinteger1-10, default: 1
PATCH /domains/{id}/registrant

Update WHOIS registrant details. Must be within the 30-day update window after registration. Domains default to proxy registration with WHOIS privacy.

DNS Management

GET /domains/{id}/dns

List all DNS records for a domain. Fetches live records from the registrar when available.

POST /domains/{id}/dns

Create a DNS record.

curl -X POST https://api.domainforagents.io/api/v1/domains/DOMAIN_ID/dns \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "@",
    "type": "A",
    "content": "76.76.21.21",
    "ttl": 3600
  }'

Supported types: A, AAAA, CNAME, MX, TXT, NS, SRV, CAA

PUT /domains/{id}/dns

Full replacement. All existing records not included in the request will be deleted. Use PATCH for safe partial updates.

PATCH /domains/{id}/dns

Merge-safe partial update. Existing records not referenced are preserved.

DELETE /domains/{id}/dns/{recordId}

Delete a specific DNS record.

PUT /domains/{id}/nameservers

Set custom nameservers. Disables managed DNS.

{
  "nameservers": ["ns1.example.com", "ns2.example.com"]
}
POST /domains/{id}/nameservers/default

Reset to default nameservers. Re-enables managed DNS.

Payments

DomainForAgents uses a prepaid balance model. Fund your account via Stripe or USDC, then spend from your balance on domain operations.

GET /balance

Get current balance in cents and recent transaction history.

POST /balance/topup

Create a Stripe PaymentIntent to add funds.

amountCentsintegerrequiredAmount in cents (min 100, max 1000000)
GET /payments/solana/deposit

Get deposit instructions for USDC (SPL on Solana). Balance is credited 1:1 upon transaction confirmation.

Response

{
  "wallet_address": "...",
  "accepted_token": "USDC",
  "usdc_mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "memo": "YOUR_ACCOUNT_ID",
  "instructions": "Send USDC to the wallet address. Include your account ID in the memo field."
}

Include your account_id in the transaction memo so we can credit the right account.

Webhooks

Subscribe to events to get notified when domain states change, payments are confirmed, or reservations expire.

POST /webhooks

Register a webhook endpoint.

curl -X POST https://api.domainforagents.io/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://myapp.com/webhook",
    "events": ["domain.registered", "domain.failed"]
  }'

Returns a secret for signature verification. Store it securely -- it's shown only once.

GET /webhooks

List all webhook subscriptions for the authenticated account.

DELETE /webhooks/{id}

Delete a webhook subscription.

Available Events

EventDescription
domain.registeredDomain successfully registered
domain.renewedDomain renewed
domain.expiredDomain or reservation expired
domain.failedRegistration failed
domain.transferredDomain transfer completed
payment.confirmedPayment received
payment.failedPayment failed
reservation.expiredSoft reservation TTL elapsed

Verifying Webhook Signatures

Every webhook delivery includes an X-Webhook-Signature header with format t=TIMESTAMP,v1=SIGNATURE.

// Node.js verification example
const crypto = require('crypto');

function verifyWebhook(body, signature, secret) {
  const [tPart, vPart] = signature.split(',');
  const timestamp = tPart.split('=')[1];
  const expected = crypto
    .createHmac('sha256', secret)
    .update(`${ timestamp }.${body}`)
    .digest('hex');
  return vPart.split('=')[1] === expected;
}

Integrations

Use DomainForAgents from any AI framework or language.

MCP Server

Claude Desktop, Cursor, any MCP client

npx @domainforagents/mcp

Setup guide · npm

LangChain

Python agents via LangChain toolkit

pip install langchain-domainforagents

PyPI

CrewAI

Multi-agent crews with domain tools

pip install crewai-tools-domainforagents

PyPI

REST API

Any language, any framework

curl -H "Authorization: Bearer KEY" \
  https://api.domainforagents.io/api/v1/domains/search?query=example.com

Quickstart · OpenAPI spec

OpenClaw

ClawHub skill for OpenClaw agents

clawhub install domainforagents

ClawHub

Browser / Web Search

No auth, no JS needed -- plain HTML

domainforagents.io/search?q=example.com

Works in any AI chat, web scraper, or browser

Discovery Protocols

ProtocolURL
OpenAPI 3.1api.domainforagents.io/api/openapi.json
MCP Registryio.github.midnight-rgb/mcp
A2A Agent Carddomainforagents.io/.well-known/agent.json
OpenAI Plugindomainforagents.io/.well-known/ai-plugin.json

Domain State Machine

Every domain progresses through defined states:

StateDescriptionTransitions to
availableFound via searchsoft_reserved, payment_pending
soft_reservedHeld with TTL, not registered upstreampayment_pending, expired
payment_pendingPayment initiated, awaiting confirmationregistering, failed
registeringUpstream registration in progressregistered, failed
registeredSuccessfully registeredtransferring, expired
failedRegistration or payment failedavailable
expiredTTL elapsed or domain expiredavailable

Errors

All errors return JSON with an error field:

{ "error": "Insufficient balance", "required": 1299, "current": 0 }
CodeMeaning
401Missing or invalid API key
402Insufficient balance or payment required
404Resource not found
409Domain already registered or account exists
429Rate limit exceeded
502Upstream registrar error