← Docs

Registry API

REST API for the AgentDNS registry. Base URL: https://agent-dns.dev.

Authentication. Public endpoints (discover, services, validate, reports) require no auth. Endpoints under /api/users/me/* and /api/users/payment-method require a Bearer JWT obtained from the gateway sign-in flow (or an active browser session if you call them from a logged-in tab).

Set the header Authorization: Bearer <registry_token> on every authenticated request.

GET/api/discover#

Search for services by intent. Returns matching services ranked by relevance, with capability matches highlighted.

Query Parameters

qstringRequired. Natural language search query.
Request
GET /api/discover?q=send+email
Response (200)
{
  "success": true,
  "query": "send email",
  "result_count": 2,
  "data": [
    {
      "service": {
        "name": "MailForge",
        "domain": "api.mailforge.dev",
        "description": "Transactional email API",
        "base_url": "https://api.mailforge.dev",
        "auth_type": "api_key",
        "pricing_type": "freemium",
        "verified": true
      },
      "matching_capabilities": [
        {
          "name": "send_email",
          "description": "Send a transactional email",
          "detail_url": "https://api.mailforge.dev/api/capabilities/send_email"
        }
      ]
    }
  ]
}
GET/api/services#

List all registered services with pagination, filtering, and sorting.

Query Parameters

categorystring?Filter by category slug
searchstring?Text search in name/description
sortstring?"newest" | "name" | "capabilities"
limitnumber?Max 100, default 50
offsetnumber?Pagination offset, default 0
POST/api/services#

Submit a new service. Two modes: auto-discover by domain, or manual manifest paste.

Mode 1: auto-discover

Request
POST /api/services
Content-Type: application/json

{
  "domain": "api.example.com"
}

The registry crawls https://api.example.com/.well-known/agent, validates, and registers the service as verified.

Mode 2: manual manifest

Request
POST /api/services
Content-Type: application/json

{
  "manifest": {
    "spec_version": "1.0",
    "name": "My API",
    "description": "...",
    "base_url": "https://api.example.com",
    "auth": { "type": "none" },
    "capabilities": [ ... ]
  }
}

Registers as unverified until the live /.well-known/agent endpoint becomes reachable.

GET/api/services/:domain#

Get detailed information about a specific registered service, including all capabilities.

Request
GET /api/services/api.mailforge.dev
GET/api/services/:domain/capabilities/:name#

Returns the full capability detail JSON: endpoint, method, parameters, request/response examples, auth scopes, rate limits. Used as a fallback when the service does not implement its own capability detail endpoints.

Request
GET /api/services/gmail.googleapis.com/capabilities/users_messages
POST/api/validate#

Validate a manifest without registering it. Useful for testing before submission.

Response (200) — Valid
{
  "valid": true,
  "errors": []
}
POST/api/reports#

Report a service for abuse, policy violation, or suspected impersonation. Reviewed by the AgentDNS team.

Request
POST /api/reports
Content-Type: application/json

{
  "domain": "suspicious-service.com",
  "reason": "Phishing — impersonating a legitimate service"
}
GET/api/config/stripe-publishable-key#

Returns the Stripe publishable key the local agent-gateway config page needs to mount Stripe Elements. Returns publishable_key: null if Stripe is not configured server-side, so the page can render gracefully.

Response (200)
{
  "success": true,
  "data": { "publishable_key": "pk_live_..." }
}
GET/api/users/me/enablementauth required#

List all services the signed-in user has toggled. Each entry includes enabled state, monthly spending cap, and whether a BYO credential blob is present.

Response (200)
{
  "success": true,
  "data": [
    {
      "user_id": 42,
      "service_id": 7,
      "domain": "api.openai.com",
      "name": "OpenAI",
      "enabled": true,
      "monthly_cap_cents": 1000,
      "has_byo_credentials": false,
      "enabled_at": "2026-04-01T10:30:00Z"
    }
  ]
}
POST/api/users/me/enablementauth required#

Upsert a per-service enablement row for the signed-in user. Either service_id or domain identifies the service. byo_credential_blob is a base64-encoded blob (set to null to clear it; omit to leave untouched).

Request
POST /api/users/me/enablement
Content-Type: application/json
Authorization: Bearer <registry_token>

{
  "domain": "api.openai.com",
  "enabled": true,
  "monthly_cap_cents": 2000
}
DELETE/api/users/me/enablement/:domainauth required#

Soft-delete the enablement (sets enabled=false). The row is kept so monthly cap and BYO credentials persist if the user re-enables later.

POST/api/users/me/billing-portalauth required#

Returns a Stripe Customer Portal session URL. The signed-in user opens this URL to manage payment methods, view invoices, and download receipts. Requires the user has already added a card (i.e. stripe_customer_id is set).

Response (200)
{
  "success": true,
  "data": { "url": "https://billing.stripe.com/p/session/..." }
}

Response format

All API responses follow a consistent format:

// Success
{ "success": true, "data": { ... } }

// Error
{ "success": false, "error": "Description of what went wrong" }

// Validation error
{ "success": false, "errors": ["error1", "error2"] }

// HTTP status codes:
// 200 — Success
// 201 — Created
// 400 — Bad request
// 401 — Not authenticated
// 403 — Blocked / forbidden
// 404 — Not found
// 409 — Conflict (already exists)
// 422 — Validation failed
// 429 — Rate limited
// 500 — Server error