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
| Tool | Description |
|---|---|
| create_account | Create account + get API key (no auth needed) |
| search_domains | Search availability and pricing |
| register_domain | Register a domain |
| reserve_domain | Soft-reserve with payment link |
| list_domains | List your domains |
| get_domain | Get domain details + DNS |
| renew_domain | Renew a domain |
| create_dns_record | Add a DNS record |
| get_dns_records | List DNS records |
| delete_dns_record | Remove a DNS record |
| set_nameservers | Set custom nameservers |
| get_balance | Check balance + transactions |
| get_usdc_deposit_info | Get USDC deposit instructions |
| create_webhook | Subscribe to events |
| list_webhooks | List 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
Create an account. Returns an API key immediately. No email required -- agents can start searching and reserving domains instantly.
Request Body
| string | Optional. Human can add later via claim code. | |
| name | string | Name 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.
Create an additional API key for the authenticated account.
| name | string | required | A label for this key |
List all API keys for the authenticated account. Returns key prefix, name, and last used timestamp. The full key is never shown after creation.
Invalidates the current API key and returns a new one. Must authenticate with the key being rotated.
Domains
Search domain availability. Returns pricing with margin applied.
Query Parameters
| query | string | required | Domain name to search (e.g. "myagent") |
Response
{
"results": [
{
"domain": "myagent.com",
"available": true,
"price_usd": 12.99,
"status": "available"
},
{
"domain": "myagent.io",
"available": true,
"price_usd": 39.99,
"status": "available"
}
]
} 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
| description | string | required | Project 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.
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
| name | string | required | Domain to register (e.g. "myagent.io") |
| years | integer | Registration period, default 1 | |
| paymentMethod | object | Default: { "type": "balance" } | |
| dnsRecords | array | DNS 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.
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.
| name | string | required | Domain to reserve |
| ttlSeconds | integer | Hold 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.
List all domains for the authenticated account with pagination and filtering.
| page | integer | Default: 1 | |
| limit | integer | 1-100, default: 20 | |
| state | string | Filter by state | |
| search | string | Search by domain name |
Get domain details including state, expiry, DNS records, and registrant info.
Renew a registered domain. Deducts from prepaid balance.
| years | integer | 1-10, default: 1 |
Update WHOIS registrant details. Must be within the 30-day update window after registration. Domains default to proxy registration with WHOIS privacy.
DNS Management
List all DNS records for a domain. Fetches live records from the registrar when available.
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
Full replacement. All existing records not included in the request will be deleted. Use PATCH for safe partial updates.
Merge-safe partial update. Existing records not referenced are preserved.
Delete a specific DNS record.
Set custom nameservers. Disables managed DNS.
{
"nameservers": ["ns1.example.com", "ns2.example.com"]
} 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 current balance in cents and recent transaction history.
Create a Stripe PaymentIntent to add funds.
| amountCents | integer | required | Amount in cents (min 100, max 1000000) |
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.
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.
List all webhook subscriptions for the authenticated account.
Delete a webhook subscription.
Available Events
| Event | Description |
|---|---|
| domain.registered | Domain successfully registered |
| domain.renewed | Domain renewed |
| domain.expired | Domain or reservation expired |
| domain.failed | Registration failed |
| domain.transferred | Domain transfer completed |
| payment.confirmed | Payment received |
| payment.failed | Payment failed |
| reservation.expired | Soft 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.
REST API
Any language, any framework
curl -H "Authorization: Bearer KEY" \ https://api.domainforagents.io/api/v1/domains/search?query=example.com
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
| Protocol | URL |
|---|---|
| OpenAPI 3.1 | api.domainforagents.io/api/openapi.json |
| MCP Registry | io.github.midnight-rgb/mcp |
| A2A Agent Card | domainforagents.io/.well-known/agent.json |
| OpenAI Plugin | domainforagents.io/.well-known/ai-plugin.json |
Domain State Machine
Every domain progresses through defined states:
| State | Description | Transitions to |
|---|---|---|
| available | Found via search | soft_reserved, payment_pending |
| soft_reserved | Held with TTL, not registered upstream | payment_pending, expired |
| payment_pending | Payment initiated, awaiting confirmation | registering, failed |
| registering | Upstream registration in progress | registered, failed |
| registered | Successfully registered | transferring, expired |
| failed | Registration or payment failed | available |
| expired | TTL elapsed or domain expired | available |
Errors
All errors return JSON with an error field:
{ "error": "Insufficient balance", "required": 1299, "current": 0 } | Code | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 402 | Insufficient balance or payment required |
| 404 | Resource not found |
| 409 | Domain already registered or account exists |
| 429 | Rate limit exceeded |
| 502 | Upstream registrar error |