Skip to main content
A route is the fundamental building block of the Agent Gateway. Each route combines three things: a URL path that agents call, a price in USD that is charged per request, and a target upstream URL that the gateway proxies to after payment is verified. Routes are scoped to your organization — agents reach them at https://gateway.meterlane.app/gateway/{orgSlug}/{routePath}. You can create and manage routes either from the Meterlane dashboard or programmatically through the management API.

What a route contains

FieldTypeDescription
pathstringURL path suffix, e.g. /summarize. Must start with /.
priceUSDnumberPer-request charge in USD, settled as USDC on-chain.
targetUrlstringFull URL of your upstream HTTP service.
networkstringChain to settle on: eip155:8453 (mainnet) or eip155:84532 (Sepolia).
activebooleanWhether the route accepts paid traffic. Defaults to true.
streamingbooleanSet to true to pipe upstream SSE responses without buffering.
discoverablebooleanList this route on x402.org Bazaar for agent discovery.
descriptionstringHuman-readable description surfaced to agents and in Bazaar listings.
bazaarCategorystringCategory tag for Bazaar discovery (e.g. "data", "ai", "finance"). Only used when discoverable is true.

Creating routes from the dashboard

The dashboard at meterlane.app/dashboard is the easiest way to create your first route.
1

Open Routes

Navigate to Dashboard → Routes and click New Route.
2

Configure the route

Fill in the path, price, and your upstream URL. Choose the network that matches your upstream environment — use Base Sepolia for staging and Base mainnet for production.
3

Save and test

Click Save. Your route is immediately live. Copy the gateway URL shown in the route detail panel and test it with curl to confirm the 402 challenge appears.

Management API

Use the management API to create and manage routes programmatically — useful for CI/CD pipelines, infrastructure-as-code, or dynamic route generation. All management API requests require your organization’s API key in the Authorization header.

Create a route

curl -X POST https://gateway.meterlane.app/api/routes \
  -H "Authorization: Bearer bp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "/summarize",
    "priceUSD": 0.01,
    "targetUrl": "https://api.yourservice.com/summarize",
    "network": "eip155:8453",
    "description": "Summarize a document with GPT-4o",
    "streaming": false,
    "discoverable": false
  }'
A successful response returns 201 with the full route object:
{
  "id": "rte_01hx…",
  "path": "/summarize",
  "priceUSD": 0.01,
  "targetUrl": "https://api.yourservice.com/summarize",
  "network": "eip155:8453",
  "active": true,
  "streaming": false,
  "discoverable": false,
  "description": "Summarize a document with GPT-4o"
}

List routes

curl https://gateway.meterlane.app/api/routes \
  -H "Authorization: Bearer bp_live_…"
Returns an array of all routes under your organization, ordered by creation date (newest first).

Update a route

Use PATCH /api/routes/{id} to change any field on an existing route. You only need to include the fields you want to update:
curl -X PATCH https://gateway.meterlane.app/api/routes/rte_01hx… \
  -H "Authorization: Bearer bp_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "priceUSD": 0.05, "active": true }'

Disable a route

Set "active": false via PATCH, or DELETE /api/routes/{id} to permanently deactivate it and remove it from Bazaar discovery. Deactivated routes return 404 to agents.

Route pricing

Every route uses a fixed per-request price denominated in USD and settled in USDC. Set priceUSD to any value greater than 0. The gateway converts your USD price to the equivalent USDC token units at the time of payment configuration — there is no dynamic FX conversion at request time.
Start with a low price (e.g. 0.001 — one tenth of a cent) while testing. You can update the price at any time via PATCH without disrupting existing agent integrations.

SSE streaming routes

If your upstream returns a Server-Sent Events stream (for example, a streaming LLM response), set "streaming": true on the route. The gateway will pipe bytes directly to the agent without buffering the full response body first.
Streaming routes settle payment before opening the upstream connection. The agent pays the full route price upfront, then receives the stream.

Discoverable routes (Bazaar)

Setting "discoverable": true on a route lists it in the x402.org Bazaar, a public registry where AI agents can discover paid HTTP APIs. Include a clear description and optionally a bazaarCategory to improve discoverability.
curl -X POST https://gateway.meterlane.app/api/routes \
  -H "Authorization: Bearer bp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "/weather",
    "priceUSD": 0.005,
    "targetUrl": "https://api.yourservice.com/weather",
    "network": "eip155:8453",
    "description": "Real-time weather data for any city",
    "discoverable": true,
    "bazaarCategory": "data"
  }'
Set "discoverable": false or call DELETE /api/routes/{id} to remove a listing from Bazaar.

Sandbox demo route

The public route at https://gateway.meterlane.app/gateway/demo/demo is a read-only sandbox maintained by Meterlane. It always responds with a 402 challenge on an unpaid request and accepts test payments on Base Sepolia. Use it to validate your agent’s x402 client integration before creating your own routes.
Do not use the demo org slug for production traffic. It is a shared sandbox and does not credit any real wallet.