Skip to main content
Routes are the core configuration objects in the Meterlane Agent Gateway. Each route binds a public URL path to an upstream HTTP service and sets the USDC price that agents must pay per request. You manage routes through the /api/routes endpoints using your Bearer API key. Changes take effect immediately — no redeployment required.

POST /api/routes

Creates a new payment route under your organisation.
POST https://gateway.meterlane.app/api/routes
Authorization: Bearer bp_live_…
Content-Type: application/json

Request body

path
string
required
The route path segment appended after your org slug, e.g. weather/forecast. Must be unique within your organisation.
priceUSD
number
required
The per-request price in USD charged to the caller, e.g. 0.01. Settled as USDC on-chain.
targetUrl
string
required
The full upstream URL that the gateway proxies paid requests to, e.g. https://api.example.com/forecast.
network
string
required
The blockchain network used for settlement. Accepted values: base, base-sepolia.
active
boolean
Whether the route accepts requests. Defaults to true. Set to false to pause the route without deleting it.
streaming
boolean
Whether the gateway streams the upstream response body. Defaults to false. Enable for SSE or chunked-transfer upstreams.
discoverable
boolean
Whether the route appears in your public route listing. Defaults to false.
description
string
A human-readable description shown in the dashboard and MCP manifest.

Example request

curl -X POST https://gateway.meterlane.app/api/routes \
  -H "Authorization: Bearer bp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "weather/forecast",
    "priceUSD": 0.01,
    "targetUrl": "https://api.example.com/forecast",
    "network": "base",
    "active": true,
    "streaming": false,
    "discoverable": true,
    "description": "Real-time weather forecast endpoint"
  }'

Response 201 Created

id
string
Unique identifier for the route, e.g. route_01hx9z2k3m4n5p6q.
orgId
string
The organisation this route belongs to.
path
string
The route path as stored.
priceUSD
number
Per-request price in USD.
targetUrl
string
The upstream URL this route proxies to.
network
string
Blockchain network used for settlement.
active
boolean
Whether the route is currently accepting requests.
streaming
boolean
Whether response streaming is enabled.
discoverable
boolean
Whether the route appears in the public listing.
{
  "id": "route_01hx9z2k3m4n5p6q",
  "orgId": "org_01hx9abcdefg",
  "path": "weather/forecast",
  "priceUSD": 0.01,
  "targetUrl": "https://api.example.com/forecast",
  "network": "base",
  "active": true,
  "streaming": false,
  "discoverable": true,
  "description": "Real-time weather forecast endpoint"
}

GET /api/routes

Returns all routes belonging to your organisation.
GET https://gateway.meterlane.app/api/routes
Authorization: Bearer bp_live_…

Example request

curl https://gateway.meterlane.app/api/routes \
  -H "Authorization: Bearer bp_live_…"

Response 200 OK

[
  {
    "id": "route_01hx9z2k3m4n5p6q",
    "orgId": "org_01hx9abcdefg",
    "path": "weather/forecast",
    "priceUSD": 0.01,
    "targetUrl": "https://api.example.com/forecast",
    "network": "base",
    "active": true,
    "streaming": false,
    "discoverable": true,
    "description": "Real-time weather forecast endpoint"
  },
  {
    "id": "route_01hx9z2k3m4n5p6r",
    "orgId": "org_01hx9abcdefg",
    "path": "news/headlines",
    "priceUSD": 0.005,
    "targetUrl": "https://api.example.com/headlines",
    "network": "base",
    "active": true,
    "streaming": false,
    "discoverable": false,
    "description": "Latest news headlines"
  }
]

PATCH /api/routes/:id

Updates one or more fields on an existing route. Only fields you include in the request body are changed.
PATCH https://gateway.meterlane.app/api/routes/:id
Authorization: Bearer bp_live_…
Content-Type: application/json

Path parameters

id
string
required
The route ID returned when the route was created, e.g. route_01hx9z2k3m4n5p6q.

Request body (all fields optional)

path
string
New route path segment. Must remain unique within your organisation.
priceUSD
number
Updated per-request price in USD.
targetUrl
string
Updated upstream URL.
network
string
Updated settlement network. Accepted values: base, base-sepolia.
active
boolean
Pass false to pause the route or true to resume it.
streaming
boolean
Enable or disable response streaming.
discoverable
boolean
Show or hide the route in the public listing.
description
string
Updated human-readable description.

Example request

curl -X PATCH https://gateway.meterlane.app/api/routes/route_01hx9z2k3m4n5p6q \
  -H "Authorization: Bearer bp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "priceUSD": 0.02,
    "active": false
  }'

Response 200 OK

Returns the full updated route object in the same shape as the POST response.

DELETE /api/routes/:id

Permanently deletes a route. Agents calling the deleted route URL will receive a 404 ROUTE_NOT_FOUND error immediately after deletion.
DELETE https://gateway.meterlane.app/api/routes/:id
Authorization: Bearer bp_live_…

Path parameters

id
string
required
The ID of the route to delete.

Example request

curl -X DELETE https://gateway.meterlane.app/api/routes/route_01hx9z2k3m4n5p6q \
  -H "Authorization: Bearer bp_live_…"

Response 204 No Content

A successful deletion returns 204 with an empty body.
Deletion is permanent. If you want to stop a route from accepting requests without losing its configuration, set active to false using PATCH instead.