> 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.md).

# Aperture

Aperture is an implementation of L402s as a reverse HTTP proxy.

Aperture is a reverse proxy that acts as a payment and authentication gateway for Lightning Network powered APIs. It can handle gRPC requests over HTTP/2 as well as REST over HTTP/1 and 2.

Aperture implements both the [L402](/the-lightning-network/l402/l402.md) as well as the [MPP](https://mpp.dev/) specifications.

Aperture receives incoming connections, verifies the validity of the [L402](/the-lightning-network/l402.md) and either forwards the request to the appropriate end point, or obtains a [Macaroon](/the-lightning-network/l402/macaroons.md) and sends it together with a Lightning invoice and the HTTP status code 402 Payment Required.

Aperture is currently used in production in Lightning [Loop](/lightning-network-tools/loop.md) and [Pool](/lightning-network-tools/pool.md).

Aperture includes a Model Context Protocol (MCP) server that makes it convenient for agents to control Aperture natively.

{% content-ref url="/pages/QRE4vENcmsPMaDM9WAfi" %}
[Get Aperture](/lightning-network-tools/aperture/get-aperture.md)
{% endcontent-ref %}

{% content-ref url="/pages/8wvWakI5qp6ASDIknMvI" %}
[Step by Step](/lightning-network-tools/aperture/step-by-step.md)
{% endcontent-ref %}

{% content-ref url="/pages/BXYPkN9nXcolCjfEYUbB" %}
[Admin Services](/lightning-network-tools/aperture/admin-services.md)
{% endcontent-ref %}

{% content-ref url="/pages/wNW5GImk3rfU7t81slOT" %}
[Machine Payments Protocol](/lightning-network-tools/aperture/machine-payments-protocol.md)
{% endcontent-ref %}

{% content-ref url="/pages/YBsPMJU3inkvDIRZ9oCD" %}
[LNC Backend](/lightning-network-tools/aperture/lnc-backend.md)
{% endcontent-ref %}

{% content-ref url="/pages/SHqxiVQ44DTHj95ceiaG" %}
[LNC Mailbox](/lightning-network-tools/aperture/mailbox.md)
{% endcontent-ref %}

{% content-ref url="/pages/UtDG2pNehZlppco3xKhf" %}
[Pricing](/lightning-network-tools/aperture/pricing.md)
{% endcontent-ref %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
