ProtectedaccountProtected OptionalappProtectedcurrentProtectedenvironmentProtectedenvironmentProtectedheliconeProtectednvmProtectedreturnProtectedschemeProtected OptionalversionBackend API version (MAJOR.MINOR) pinned by this instance, set from
options.version. When unset, every request defaults to
LOCKED_API_VERSION.
Performs an HTTP request, paying an MPP challenge if the endpoint returns one.
The buyer needs no new plan, delegation or credential: the delegation that works for x402 works here unchanged.
init.body, if set, must be replayable if the endpoint may challenge
the request: a ReadableStream throws a typed PaymentsError
once a 402 challenge actually requires a retry, since the stream cannot
be resent. A request that is never challenged sends a stream body exactly
once, exactly like plain fetch — the paid: false / untouched-response
guarantee still holds. A string, Buffer/ArrayBuffer/typed array,
URLSearchParams, FormData or Blob body all work unchanged either way.
options.delegationConfig must carry a delegationId — this call
refuses the deprecated inline create-on-the-fly shape (no delegationId)
that X402TokenAPI.getX402AccessToken otherwise tolerates with a
warning: the retry loop here can mint an access token twice per call, so
that shape could silently create two delegations as a side effect of
paying.
It returns the account address associated with the NVM API Key used to initialize the Payments Library instance.
The account address extracted from the NVM API Key
ProtectedgetInternalReturns the HTTP options required to query the backend.
HTTP method.
Optionalbody: anyOptional request body.
OptionalextraHeaders: Record<string, string>Optional per-call header overrides. Use
{ 'X-Current-Org-Id': orgId } to target a specific workspace for
one call without mutating the instance-level pin.
HTTP options object.
Returns the environment name used to initialize the Payments instance.
The environment name (e.g. 'sandbox', 'live')
Mints an access token signed under the Nevermined-MPP EIP-712 domain.
Same inputs and same settlement rail as X402TokenAPI.getX402AccessToken
minus tokenVersion; the token verifies only on the MPP routes, which is
what keeps the two protocols isolated.
MPP carries no token version (nvm-monorepo#3266): its single-use unit is
the challenge, not the token, so one MPP token is presented across many
challenges by design. The parameter type says so, and a JavaScript caller
that sends one anyway is refused before the request — the backend answers
BCK.MPP.0007 for any value, 2 included.
OptionalagentId: stringOptionaltokenOptions: MppTokenOptionsReturns the current organization context applied to every authenticated
backend request via the X-Current-Org-Id header.
null means "no pinned workspace" — the backend falls back to the
caller's API-key tag or most-recent active membership.
ProtectedgetInternalGet HTTP options for public backend requests (no authorization header). Converts body keys from snake_case to camelCase for consistency.
HTTP method
Optionalbody: anyOptional request body (keys will be converted to camelCase)
HTTP options object
Mints the challenge a plan-protected endpoint returns with its 402.
Each call returns a distinct challenge even for identical inputs — the id doubles as the burn idempotency key, so two requests sharing one would settle as a single burn.
ProtectedparseSets the organization context applied to every subsequent authenticated
backend request via the X-Current-Org-Id header.
Pass null to clear the pin and fall back to the backend default.
Org ID (e.g. org-…) or null to clear.
Verifies and burns through the same chokepoint an x402 settlement uses, so the credits charged are identical on both protocols. Settling the same credential twice burns once.
Runs the full credential and plan checks without burning anything.
Staticget
Machine Payments Protocol (MPP) module.