Skip to main content
POST
Route and pay using the delegation from your commerce grant (mode B, OAuth)

Authorizations

Authorization
string
header
required

Your Nevermined API Key (starts with 'nvm:'). Get one at nevermined.app under Settings > API Keys.

Body

application/json
requestId
string
required

Idempotency key — REQUIRED for routed payments (mode B). The Router makes the upstream call and pays automatically, so a retry after a dropped connection must not double-spend. At most one payment is minted per (caller, requestId); a duplicate returns 409 (BCK.ROUTER.0002) carrying the original paymentId, rather than paying again.

Example:

"order-1234"

url
string

Absolute upstream URL to route to (http/https only). Provide EXACTLY ONE of url or slug — both together is a 400. Use slug for a cataloged service (the opaque broker); url is for an off-catalog target you already hold the URL of.

Example:

"https://agent.example/api/resource"

slug
string

Catalog slug to invoke via the opaque Router broker. The Router resolves the slug to the real upstream server-side, so the URL is never exposed. Mutually exclusive with url.

Example:

"webscrape-pro"

path
string

Optional subpath appended to the resolved upstream when slug is used (e.g. scrape → the merchant's /scrape). Path segments only — it may not change the host, so //, @, .. and an embedded absolute URL are rejected (400). Ignored when url is used.

Example:

"scrape"

method
enum<string>
default:GET

HTTP method to use for the upstream request.

Available options:
GET,
POST,
PUT,
PATCH,
DELETE
headers
object

Headers to forward to the upstream (e.g. the agent’s own auth). Optional.

body
any

Request body to forward (JSON). Optional.

protocol
enum<string>
default:x402

Payment protocol. On the mode-B proxy (/route, /proxy) this is ADVISORY: the Router AUTO-DETECTS the protocol from the upstream 402 — WWW-Authenticate: Paymentmpp; accepts / PAYMENT-REQUIREDx402 — and the DETECTED protocol is authoritative for the mint (a mismatching hint here does not change what gets paid).

Available options:
x402,
mpp

Response

Upstream response, relayed.

status
number
required

The upstream HTTP status code that was relayed.

Example:

200

body
any
required

The upstream response body (parsed JSON when the upstream returned JSON, else a string).

Example:
paid
boolean
required

Whether a payment was made (false = the upstream was free).

Example:

true

payment
object

The payment made, when paid is true.