Workshop / P.I.M.P. Services
Public Testnet Beta
Machines pay
machines.
An agent needs data. An API supplies it. Lightning makes the payment in between possible — directly, in satoshis and as part of the request.
P.I.M.P. Services is our experiment with paid interfaces for programs and AI agents. We are starting with BTC market data: a 14-period RSI based on hourly candles, using LNMarkets as the data source.
The first service
BTC / RSI 14
A clearly defined piece of data for your own applications. The beta tests the path from the initial request through a test payment to the authorised response.
- Timeframe
- 1-hour candles
- Data source
- LNMarkets
- Beta price
- 25 testnet sats
- Access
- Lightning / L402 / x402
L402: 25 testnet sats for reusable beta access. We have verified one payment followed by two successful requests to the same endpoint. The validity period and other usage limits have not yet been fully tested. There is no promise of unlimited use or a year of availability. No mainnet payments.
x402 / Lightning / Testnet
25 testnet sats per request.
Alongside L402, an x402 endpoint now serves the same BTC RSI14 data. Each invoice costs 25 testnet sats plus routing fees and authorises one data delivery. Our Python client validates the payment request, pays through your own testnet LND and submits proof with the data request.
https://x402.andyzyklisch.de/v1/btc/rsi14Public test passed: 25 September 2026. HTTP 402 → Lightning payment → verified JSON response. The actual routing fee was 1.1 sats with a 2-sat limit, totalling 26.1 testnet sats. Future fees may differ. This verifies our client and gateway; compatibility with arbitrary x402 agents has not yet been established.
Check availability without paying
curl --fail --silent --show-error --max-time 15 https://x402.andyzyklisch.de/healthzExpected: {"network":"testnet","status":"alive"}. This request creates no invoice and only checks gateway process availability, not payment readiness.
Get started with the Python client
You need a synchronised Bitcoin testnet LND with test sats, a payable route, a local TLS certificate and a scoped buyer macaroon for GetInfo and SendPaymentV2. A mainnet wallet is not sufficient. Reference client v0.2 runs with Python 3.12; install its dependencies in a virtual environment.
Download reference package v0.2 (ZIP)
Verify package and install dependencies
echo 'bc0665b0c897fa1ee89a93c7422a33e54944ff60243683a7ed8f8e13ba97e947 pimp-x402-testnet-v0.2.zip' | sha256sum -c -
unzip -n pimp-x402-testnet-v0.2.zip
cd pimp-x402-testnet-v0.2
sha256sum -c SHA256SUMS
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txtStop if verification fails. The package README records the original preparation stage; the public test described above took place afterwards.
Replace both /PATH/TO/ paths with your local files. The LND address must match your locally reachable buyer node. Run this command in the package directory to purchase for 25 testnet sats with a maximum routing fee of 2 sats. The state file must not already exist.
.venv/bin/python client.py \
--pay-testnet \
--url https://x402.andyzyklisch.de/v1/btc/rsi14 \
--receiver-pubkey 03623b32298e6a0e0ce73a773c655eebc75dc19a368221146a3a2d133b59739414 \
--fee-limit-msat 2000 \
--lnd-url https://127.0.0.1:28081 \
--tls-cert /PATH/TO/buyer.cert \
--macaroon /PATH/TO/buyer.macaroon \
--state client-attempt-once.jsonHandle payments and errors
The client handles PAYMENT-REQUIRED, PAYMENT-SIGNATURE and PAYMENT-RESPONSE. It checks the amount, recipient and signed binding to the public URL. Without proof, the RSI endpoint returns HTTP 402 and creates an invoice. A global limit of 60 invoice attempts per rolling hour applies; exhaustion returns HTTP 429. Unpaid invoices count too.
After an error or disconnect, retain the state file and reconcile payment and delivery before retrying. Do not blindly purchase again with a new file. A redeemed proof remains consumed even if the backend subsequently fails. Automatic refunds or repeat delivery are not implemented. State files may contain payment proofs: do not publish them.
The response includes the RSI, candle timestamp and snapshot age. Check freshness before use. The beta does not execute trades.
Try API
L402: The unpaid request.
Test the endpoint without proof of payment. With L402 access control active, HTTP 402 Payment Required is the expected response: it requests payment. This test does not itself make a payment.
GET https://pimp.andyzyklisch.de/v1/btc/rsi14
No request sent yet.
Try it in your terminal
curl --max-time 15 -i 'https://pimp.andyzyklisch.de/v1/btc/rsi14'This button does not pay an invoice or unlock data. Requirements for paid requests are listed under “How L402 works”. Do not share access tokens or proof of payment publicly.
Testnet means testing with test satoshis. Availability and responses may change during the beta. The display above shows the result of your request, not a continuously monitored service status.
After successful authorisation
The data your program receives.
The API returns JSON containing the RSI, reported state, latest candle and age of the data snapshot. The example below comes from an actual backend request on 16 September 2026 and does not show current market data.
{
"candles": 500,
"data_source": "pimp-public-market-bridge",
"last_candle_timestamp": "2026-09-16T09:00:00+00:00",
"last_close": 75823,
"market_source": "lnmarkets",
"payment_gate": "aperture",
"rsi": 43.4416,
"rsi_period": 14,
"snapshot_age_seconds": 259.7,
"state": "neutral",
"symbol": "BTC",
"timeframe": "1h"
}rsi is the indicator value over rsi_period periods. candles gives the number of candles; last_candle_timestamp the timestamp of the latest candle in UTC, and last_close its closing price. snapshot_age_seconds describes the snapshot’s age in seconds at the time of the request. Check the timestamp and age before using the data.
From request to response
How L402 works.
What you need for a paid request
A Lightning environment on the appropriate Bitcoin testnet, with test satoshis and a payable route to the invoice, plus a client that provides the preimage after payment. Your HTTP client must be able to send the access token and this preimage as proof of payment. An ordinary mainnet wallet and the demo button alone are not enough.
Open the step-by-step guide using LND / lncli and curl →
For testers with an existing testnet node. The guide is based on our successful payment test; independent testing is still outstanding.
- 01
Request data
Your program calls the API endpoint. Without valid proof of payment, the service may respond with HTTP 402.
- 02
Pay the test invoice
The L402 response includes an access token and a Lightning invoice in the
WWW-Authenticateheader. A suitable testnet client checks the invoice and pays it with test satoshis. - 03
Send proof of payment
The client repeats the request with the token and proof of payment, known as the preimage. The service checks both and releases the resource if authorisation is valid.
Technical background: Lightning Labs L402 documentation.
Try it together
Looking for testers.
Do you build agents, use Lightning or want to try the API in your own project? We want to hear about clear responses, working flows and the places where things still get stuck. Send us your experiences and questions.
Get in touch about the beta