ArkAPI.devFund
Standard L402 • Bitcoin mainnet • live

Pay for API calls with Bitcoin over Lightning.

ArkAPI issues a standard L402 macaroon and Lightning invoice at the API boundary. Pay 100 sats, present the payment preimage, and reuse the resulting credit for successful 5-sat calls—without an account, card, or API key.

BOLT11MacaroonsLSAT aliasReusable creditHTTPS + Tor + I2P

The L402 flow

# 1. Request a protected route and receive HTTP 402 curl -i 'https://arkapi.dev/api/btc-price?currency=USD' # WWW-Authenticate: L402 macaroon="...", invoice="lnbc..." # 2. Validate and pay the 100-sat BOLT11 invoice. # 3. Retrieve the 32-byte Lightning payment preimage. # 4. Reuse the credential: curl -H 'Authorization: L402 <macaroon>:<payment_preimage>' \ 'https://arkapi.dev/api/btc-price?currency=USD'

The legacy LSAT authorization scheme is accepted as an alias. New credentials use the current L402 identifier layout and standard padded Base64 encoding.

What agents should enforce

  • Decode and independently verify the BOLT11 amount and network.
  • Use a dedicated payer with per-payment and daily limits.
  • Cache a verified credential rather than paying on every request.
  • Treat an uncertain payment result as unresolved; never pay it again blindly.
  • Keep macaroons and preimages outside prompts and logs.

Where Bark fits

Bark creates and settles ArkAPI's Lightning invoices. The payer can be any compatible mainnet Lightning wallet that returns the payment preimage. It does not need to understand L402 itself.

For Ark-native payment and request signing, ArkAPI separately supports Ark-402. For persistent credit funded over either Lightning or Ark, use a Bearer session.

L402 and MCP

ArkAPI client 0.1.7 exposes arkapi_payment_methods so an MCP agent can discover public, Bearer, L402, and Ark-402 access plus supported transports. Its built-in payment automation remains limited to Bearer and Ark-402. Standard L402 clients should call the HTTP API directly and use a separately constrained Lightning payer.

This distinction keeps discovery interoperable without silently granting a general-purpose MCP process permission to spend from a Lightning wallet.

L402 FAQ

Is L402 live on ArkAPI mainnet?

Yes. Protected API routes and the OpenAI-compatible Chat API return an L402 challenge alongside Ark-402 discovery.

How much is the challenge?

The invoice is fixed at 100 sats. Credit is charged at the published price for each successful API call; the standard price is 5 sats.

Are Cashu or x402 accepted?

No. Cashu and x402 are not implemented payment methods. They are not aliases for L402.