---
raw: true
title: Find and buy a domain
description: Search for a name, check that it's available, and register it to your team at cost, from an agent, the CLI, or the API
---

Spacefast registers domains at cost: the registry price plus the ICANN fee. A domain you buy belongs to your team, renews on its own, and doesn't count toward your plan's custom domain limit. Once it's registered, [connect it to a Space](/docs/domains/).

The fastest path is to ask your agent: "Find me a domain for a cozy bakery in Brooklyn, and buy the one I pick." The rest of this page is what the agent does.

## Find names

Search takes a keyword or a naming brief. A keyword checks exact matches and domain hacks. A brief generates ideas. You don't need an account.

```bash
sf domains search "a cozy bakery in Brooklyn" --json > names.json
sf domains search "shorter, playful names" --input @names.json --like 2 --select 3 --json
```

Over the API, send `POST /v1/domains/search` with `{ "message": "a cozy bakery in Brooklyn" }`. Send the returned `data.session` back unchanged on the next call, with a new `message` or `feedback`. Each suggestion shows its availability, a fee-inclusive first-year price, and an estimate for later years.

A suggestion isn't proof that a name can be bought. Check it before you buy.

## Check availability and price

```bash
curl "https://api.spacefast.com/v1/domains/research/availability?name=example.com"
```

The answer says whether the name is `available` and `purchasable`, and gives its `price`. Premium names can show as available but not purchasable. To check many names at once, send `POST /v1/domains/research/availability` with `mode: "live"`. The default mode uses older zone data without prices.

## Save who owns it

A domain is registered to a person or organization, the registrant. Save one before your first purchase, with real details. An agent asks you for them and never makes them up.

```bash
sf domains contacts add --file contact.json
```

The file needs `firstName`, `lastName`, `address1`, `city`, `state`, `postalCode`, `countryCode`, `email`, and `phone`. `organization` and `address2` are optional. Over the API, it's `POST /v1/domains/contacts`.

A contact belongs to the person who saved it, so sign in as yourself. Team API keys can't save contacts or buy domains.

## Buy

One purchase holds up to 10 apex domains, like `example.com` and not `app.example.com`. The team's saved payment method pays.

```bash
sf domains registration purchase example.com example.dev
```

Without `--expect-total`, this holds the names and shows the total. Nothing is charged. To charge now, pass the total before tax that you agreed to:

```bash
sf domains registration purchase example.com --expect-total 10.34
```

Over the API, send `POST /v1/domains/purchases` with `domains`, `contactId`, and `expectedTotalCents`.

What happens next depends on who's buying:

| You have | Result |
| --- | --- |
| Purchasing power (`billing:purchase` on the paying team) and the total | Charged now |
| No purchasing power, or no total | Held as `awaiting_confirmation`. A team admin confirms it at `purchase.confirmUrl` |
| No usable payment method | Held as `awaiting_payment_method`. At `confirmUrl`, a team admin adds one and confirms |
| A Stripe shared payment token from an agent wallet | Pass `--payment-token spt_...` with `--expect-total`. The token pays instead of the saved payment method |

An agent without purchasing power gives you `confirmUrl` and stops. It doesn't retry or open a payment page itself.

If any name in the cart can't be bought, the whole purchase is refused with [`domain_not_purchasable`](/docs/errors/domain_not_purchasable/). Drop that name and buy the rest. If the live total no longer matches the one you sent, the purchase is refused with `purchase_total_changed`. Look at the new total and buy again.

## Check that it registered

```bash
sf domains registration example.com
```

A paid purchase moves from `pending_payment` to `pending_registration` to `active`. If the registry refuses the name, the registration shows `failed` with a reason, and the payment is refunded. Over the API, read `GET /v1/teams/{teamId}/purchases/{purchaseId}` until it's `paid`, then `GET /v1/domains/{domainId}/registration`.

## Renewals

A registered domain renews for a year on the team's saved payment method. The charge comes no sooner than 30 days before expiry, and no sooner than a week after the team is told. Turn renewal off with `sf domains registration example.com --no-auto-renew`, or renew now with `sf domains registration renew example.com`.

## In Claude, ChatGPT, and other MCP hosts

Ask your agent to find or buy a domain. In a host that shows MCP Apps, the Domains app opens. There you compare names and prices, add owner details in a form, and confirm the purchase. In other hosts, the agent gives you a link to finish on Spacefast.

## Next steps

- [Connect the domain to a Space](/docs/domains/)
- [`sf domains` commands](/docs/cli/domains/)
- [Error reference](/docs/errors/)
