> For the complete documentation index, see [llms.txt](https://docs.lightning.engineering/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lightning.engineering/lightning-network-tools/aperture/machine-payments-protocol.md).

# Machine Payments Protocol

Unlike L402, the Machine Payments Protocol (MPP, not to be confused with Multi-path Payments) allows for payments over multiple payment rails, and is not limited to Lightning Network payments.

Instead of macaroons, it uses credentials, which can either be for a single or multiple uses.

Instead of payment hashes, it uses payment receipts, which are issued by the service upon successful payment, and are passed together with the credential when requesting the resource.

[Read more: MPP](https://mpp.dev/)

## Enable MPP <a href="#docs-internal-guid-e28c0235-7fff-e9b1-4f1b-555c22663108" id="docs-internal-guid-e28c0235-7fff-e9b1-4f1b-555c22663108"></a>

Aperture implements MPP alongside L402.

To enable MPP, amend your `aperture.yaml` file in the authenticator and services sections. You may serve and authenticate L402 and MPP in parallel.

```yaml
authenticator:
  # Enable the Payment HTTP Authentication Scheme (MPP) alongside L402.
  # When enabled, 402 responses include both L402 and Payment challenges.
  # enablempp: true

  # Realm string used in MPP challenge headers. Defaults to the server's
  # listen address.
  # mpprealm: "api.example.com"

  # Enable MPP session intent for prepaid sessions with deposit, bearer,
  # top-up, and close operations. Requires enablempp to be true.
  # enablesessions: true

services:
   # Payment auth scheme for this service. Valid values: "l402" (default),
   # "mpp" (Payment HTTP Auth only), or "l402+mpp" (both schemes).
   # authscheme: "l402"

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lightning.engineering/lightning-network-tools/aperture/machine-payments-protocol.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
