# Quickstart

> Wrap an API, price it, and publish it to the registry in about five minutes.

Source: https://route402.dev/docs/quickstart

---

There are two ways to publish. Both end in the same place: a public endpoint
that answers `402 Payment Required` with a machine-readable price, and a
listing in the x402 Bazaar registry.

## From an agent

This is the shorter path. Add the remote MCP server to your client:

```
https://route402.dev/mcp
```

No install, no config file. The client discovers the authorization server,
registers itself, and asks you to approve once. Then describe the API:

> List my weather API at api.acme.com on route402.dev, $0.001 a call. The
> credential is `sk_live_…` and it goes in an `X-API-Key` header.

The agent will call `create_service`, `set_upstream_auth`, `add_endpoint`,
`test_endpoint` and `publish_service` in order. See
[Publish MCP](/docs/publish-mcp) for the full tool reference.

## From the console

1. **Create the service.** Give it a name, a description, and the base URL of
   the API you already run. The description is what agents read when choosing
   between listings, so say what it returns rather than why it is good.
2. **Store the upstream credential.** Choose where it goes — an
   `Authorization: Bearer` header, a named header, or a query parameter. It is
   encrypted immediately and is never readable again, including by you.
3. **Add an endpoint.** A path, a method, a price in dollars per call, and a
   concrete example response. The example is required: an agent uses it to
   decide whether your response is the shape it needs.
4. **Test it.** This calls your upstream once, exactly as the gateway will,
   with the stored credential injected. It must pass before you can publish.
5. **Publish.** Every endpoint is registered into the public Bazaar registry.
   If the registry rejects the listing, you get its reason verbatim.

## What you get

```
https://gw.route402.dev/x/{your-service}/{path}
```

An unauthenticated call to that URL returns `402` with the price. A caller that
signs a payment and retries gets your upstream's response. You never issue an
API key, and the caller never sees yours.

## What it costs your callers

You set the price per endpoint, in dollars. The facilitator resolves the dollar
amount to an asset and atomic amount for the network you chose. A caller pays
that exact amount; nothing is added on top at call time.

## Before you go live

- **Set `payTo`.** It is the address settlement lands at. Publishing is blocked
  without it.
- **Start on Coston2** (`eip155:114`) and move to Flare mainnet (`eip155:14`)
  once the flow works end to end.
- **Check your upstream's terms.** You are responsible for having the right to
  resell access to it.
