BTCPay Server Lightning (Internal Node) API

Lightning (Internal Node) operations

GitHub OpenAPI

Operations 13

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/v1/server/lightning/{cryptoCode}/info Get information about the lightning node · Get node information #
Ask an LLM
“What is the status of my lightning node?”
“Can I check the node's details before opening channels?”
Tell an agent
Get information about the {cryptoCode} lightning node.
Show the status of the {cryptoCode} node.
GET /api/v1/server/lightning/{cryptoCode}/balance Check the lightning node balance · Get node balance #
Ask an LLM
“How much balance does my lightning node hold?”
“Is there a way to see the node's balance before paying invoices?”
Tell an agent
Get the balance of the {cryptoCode} lightning node.
Show how much {cryptoCode} is available on the node.
GET /api/v1/server/lightning/{cryptoCode}/histogram Get the lightning node balance histogram · Get node balance histogram #
Ask an LLM
“What is the balance distribution across my lightning channels?”
“Can I see how much capacity is used across the node's channels?”
Tell an agent
Show the balance histogram for the {cryptoCode} lightning node.
Get the channel capacity histogram for {cryptoCode}.
POST /api/v1/server/lightning/{cryptoCode}/connect Connect to another lightning node · Connect to lightning node #
Ask an LLM
“How do I connect my lightning node to another node?”
“Can I add a peer to my node by its pubkey and endpoint?”
Tell an agent
Connect to the {cryptoCode} lightning node at {nodeURI}.
Add a peer to {cryptoCode} with URI {nodeURI}.
GET /api/v1/server/lightning/{cryptoCode}/channels List the lightning node's channels · Get channels #
Ask an LLM
“Which channels does my lightning node have?”
“Can I see the capacity and balance of each channel?”
Tell an agent
List the channels of the {cryptoCode} lightning node.
Show channel details for the {cryptoCode} node.
POST /api/v1/server/lightning/{cryptoCode}/channels Open a channel to another node · Open channel #
Ask an LLM
“How do I open a channel to another lightning node?”
“Can I set a fee rate when opening a channel?”
Tell an agent
Open a {channelAmount} satoshi channel to {nodeURI} on {cryptoCode}.
Open a {channelAmount} satoshi channel to {nodeURI} on {cryptoCode} at a fee rate of {feeRate} satoshi per byte.
POST /api/v1/server/lightning/{cryptoCode}/address Get an on-chain deposit address for the node · Get deposit address #
Ask an LLM
“Where do I send on-chain funds to add capacity to my lightning node?”
“Can I get a deposit address for my node's channel?”
Tell an agent
Get an on-chain deposit address for the {cryptoCode} lightning node.
Create a deposit address on {cryptoCode} to top up node capacity.
GET /api/v1/server/lightning/{cryptoCode}/payments/{paymentHash} Get a lightning payment by hash · Get payment #
Ask an LLM
“Has a specific lightning payment been settled?”
“Can I look up a payment by its payment hash?”
Tell an agent
Get the {cryptoCode} lightning payment with hash {paymentHash}.
Check whether payment {paymentHash} on {cryptoCode} succeeded.
GET /api/v1/server/lightning/{cryptoCode}/invoices/{id} Get a lightning invoice · Get invoice #
Ask an LLM
“What are the details of a specific lightning invoice?”
“Can I fetch one invoice by its id?”
Tell an agent
Get the {cryptoCode} lightning invoice {id}.
Show the details of invoice {id} on {cryptoCode}.
POST /api/v1/server/lightning/{cryptoCode}/invoices/pay Pay a lightning invoice · Pay Lightning Invoice #
Ask an LLM
“How do I pay a BOLT11 lightning invoice?”
“Can I cap the fee when paying an invoice?”
Tell an agent
Pay the {cryptoCode} lightning invoice {BOLT11}.
Pay {BOLT11} on {cryptoCode} with a maximum fee of {maxFeePercent} percent.
GET /api/v1/server/lightning/{cryptoCode}/invoices List lightning invoices · Get invoices #
Ask an LLM
“Which lightning invoices have I created?”
“Can I list only pending invoices?”
Tell an agent
Get the {cryptoCode} lightning invoices.
List {cryptoCode} invoices where pendingOnly is {pendingOnly}.
POST /api/v1/server/lightning/{cryptoCode}/invoices Create a lightning invoice · Create lightning invoice #
Ask an LLM
“How do I create a lightning invoice for a customer?”
“Can I make an invoice private with route hints?”
Tell an agent
Create a {cryptoCode} lightning invoice for {amount}.
Create a {cryptoCode} invoice for {amount} with description {description}.
GET /api/v1/server/lightning/{cryptoCode}/payments List lightning payments · Get payments #
Ask an LLM
“Which lightning payments have I made?”
“Can I include pending payments in the list?”
Tell an agent
Get the {cryptoCode} lightning payments.
List {cryptoCode} payments including pending ones: {includePending}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/btcpay:btcpay-lightning-internal-node-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

btcpay-lightning-internal-node-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: BTCPay Greenfield Lightning (Internal Node) API
  version: v1
  description: '# Introduction


    The BTCPay Server Greenfield API is a REST API. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.


    # Authentication


    You can authenticate either via Basic Auth or an API key. It''s recommended to use an API key for better security. You can create an API key in the BTCPay Server UI under `Account` -> `Manage Account` -> `API keys`. You can restrict the API key for one or multiple stores and for specific permissions. For testing purposes, you can give it the ''Unrestricted access'' permission. On production you should limit the permissions to the actual endpoints you use, you can see the required permission on the API docs at the top of each endpoint under `AUTHORIZATIONS`.


    If you want to simplify the process of creating API keys for your users, you can use the Authorization endpoint to predefine permissions and redirect your users to the BTCPay Server Authorization UI. You can find more information about this on the API Authorization Flow docs page.


    # Usage examples


    Use **Basic Auth** to read store information with cURL:

    ```bash

    BTCPAY_INSTANCE="https://mainnet.demo.btcpayserver.org"

    USER="MyTestUser@gmail.com"

    PASSWORD="notverysecurepassword"

    PERMISSION="btcpay.store.canmodifystoresettings"

    BODY="$(echo "{}" | jq --arg "a" "$PERMISSION" ''. + {permissions:[$a]}'')"


    API_KEY="$(curl -s \

    -H "Content-Type: application/json" \

    --user "$USER:$PASSWORD" \

    -X POST \

    -d "$BODY" \

    "$BTCPAY_INSTANCE/api/v1/api-keys" | jq -r .apiKey)"

    ```


    Use an **API key** to read store information with cURL:

    ```bash

    STORE_ID="yourStoreId"


    curl -s \

    -H "Content-Type: application/json" \

    -H "Authorization: token $API_KEY" \

    -X GET \

    "$BTCPAY_INSTANCE/api/v1/stores/$STORE_ID"

    ```


    You can find more examples on our docs for different programming languages:

    - cURL

    - Javascript/Node.Js

    - PHP'
  contact:
    name: BTCPay Server
    url: https://btcpayserver.org
  license:
    name: MIT
    url: https://github.com/btcpayserver/btcpayserver/blob/master/LICENSE
servers:
- url: /
  description: BTCPay Server Greenfield API
security:
- API_Key: []
  Basic: []
tags:


# --- truncated at 32 KB (33 KB total) ---
# Full source: https://artifacts.apis.io/btcpay/openapi/btcpay-lightning-internal-node-api-openapi.yml