Skip to main content
POST
Route a request through the Router, paying the agent’s 402 and relaying the reply (mode B)

Authorizations

Authorization
string
header
required

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

Body

application/json
delegationId
string
required

The caller's erc4337 delegation to spend against (as in POST /router/payments).

url
string
required

Absolute upstream URL to route to (http/https only).

Example:

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

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"

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

The relayed upstream response (status + body) plus the payment that was made.

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.