name.ai

Quick start

From zero to your first signed API call in under 10 minutes. No approval needed for sandbox.

Prerequisites

✓ A partner account (apply at /partners/apply).

✓ Sandbox credentials issued by name.ai: a key id (pk_sandbox_…) and secret (sk_sandbox_…).

✓ Node.js 18+ or Python 3.9+ on your machine.

1

Store your credentials as environment variables

Never hardcode credentials. Store them server-side only.

Shell (bash / zsh)
export NAMEAI_KEY_ID="pk_sandbox_your_key_id_here"
export NAMEAI_API_SECRET="sk_sandbox_your_secret_here"
2

Copy the signing helper

All requests must be signed with HMAC-SHA256. Copy this helper once — you'll reuse it for every call. Full details: Authentication.

sign.mjs
import crypto from "crypto";

const EMPTY_SHA256 = crypto.createHash("sha256").update("").digest("hex");

function canonicalizeQuery(searchParams) {
  const params = Array.from(
    (searchParams instanceof URLSearchParams ? searchParams : new URLSearchParams(searchParams || "")).entries()
  );
  return params
    .sort(([a], [b]) => a.localeCompare(b))
    .map(([k, v]) => {
      const enc = (s) => encodeURIComponent(s).replace(/[!'()*]/g, (c) => "%" + c.charCodeAt(0).toString(16).toUpperCase());
      return enc(k) + "=" + enc(v);
    })
    .join("&");
}

export function signRequest({ secret, method, url, body = "", timestamp, nonce }) {
  const u = new URL(url);
  const bodyHash = body ? crypto.createHash("sha256").update(body, "utf8").digest("hex") : EMPTY_SHA256;
  const canonical = [method.toUpperCase(), u.pathname, canonicalizeQuery(u.searchParams), timestamp, nonce, bodyHash].join("\n");
  const sig = crypto.createHmac("sha256", secret).update(canonical, "utf8").digest("hex");
  return "v1=" + sig;
}
3

Make your first search call

Search the DSN for available domains. Scope required: search.

search.mjs
import crypto from "crypto";
import { signRequest } from "./sign.mjs";

const KEY_ID = process.env.NAMEAI_KEY_ID;
const SECRET  = process.env.NAMEAI_API_SECRET;
const BASE    = "https://name.ai"; // same for sandbox and live — the credential picks the tier

const url  = `${BASE}/api/partner/v1/domains/search?q=ai`;
const ts   = String(Math.floor(Date.now() / 1000));
const nonce = crypto.randomUUID();
const sig  = signRequest({ secret: SECRET, method: "GET", url, body: "", timestamp: ts, nonce });

const res  = await fetch(url, {
  headers: {
    "X-NameAI-Key-Id":    KEY_ID,
    "X-NameAI-Timestamp": ts,
    "X-NameAI-Nonce":     nonce,
    "X-NameAI-Signature": sig,
  },
});
console.log(await res.json());

Expected response shape:

{
  "query": "ai",
  "count": 3,
  "results": [
    { "domain": "buildinai.com", "bin_price": 450000, "currency": "USD", "available": true },
    { "domain": "launchwithai.com", "bin_price": 250000, "currency": "USD", "available": true }
  ]
}
4

Choose your payment model

MoR partner

You collect payment from the buyer. Next: MoR order flow →

Non-MoR partner

Name.ai collects payment. Next: Pay with name.ai →

5

Go live

When you are ready to serve real buyers, contact name.ai to have live credentials issued. Switch your key id/secret from pk_sandbox_ / sk_sandbox_ to pk_live_ / sk_live_. No code changes required — the API paths are identical.

Syndicate Partner API — Quick start — name.ai