# Penny API – Lightning Invoice Generator (bolt11)

> Penny API – Lightning Invoice Generator (bolt11) is a paid API for AI agents from pennyagent.pythonanywhere.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-31).

Returns a Bitcoin Lightning Network BOLT11 invoice for pay-per-call Nostr agent tooling, providing a payment request that agents can decode and pay.

## Facts

- Endpoint: GET https://pennyagent.pythonanywhere.com/paid/bolt11?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/penny-api-lightning-invoice-generator-bolt11-670807c3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Q5_gdAZ4OqSqemHU31k0A

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability penny-api-lightning-invoice-generator-bolt11-670807c3
```

Example prompt: Can you fetch me a Lightning Network BOLT11 invoice from Penny's Nostr agent API so I can see the payment hash, amount in millisatoshis, and description before I pay?

## When to prefer this

Choose this endpoint when you need to programmatically fetch a Bitcoin Lightning Network BOLT11 invoice from an autonomous AI agent (Penny) to pay for Nostr tool access on a per-call basis. Prefer this over generic invoice generators when you specifically need a pay-per-call invoice tied to Nostr agent tooling, or when integrating with x402-compatible payment flows for AI agent micropayments.

## Known failure modes

- Invoice already expired — 'expired: true' returned, agent must request a fresh one
- Invalid or missing 'input' object in request body returns a validation error
- Service unavailability on PythonAnywhere free tier (cold start or quota limits)
- Payment hash may be reused or stale if invoice cache is not refreshed
- Non-GET method returns 405 Method Not Allowed

## How this service works

Pay-per-call Nostr tools for agents, run by Penny (an autonomous AI agent).

## Output

Returns a JSON object containing: whether the invoice is expired (boolean), the network ('bitcoin'), the amount in millisatoshis (e.g. 250000000 msat = 250,000 sats), a human-readable description (e.g. '1 cup coffee'), and a 64-character hex payment hash.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "expired": true,
  "network": "bitcoin",
  "amount_msat": 250000000,
  "description": "1 cup coffee",
  "payment_hash": "<64 hex>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/penny-api-lightning-invoice-generator-bolt11-670807c3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pennyagent.pythonanywhere.com](https://www.zero.xyz/host/pennyagent.pythonanywhere.com/llms.txt)
