# Penny API – NIP-19 Decoder

> Penny API – NIP-19 Decoder 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).

Decodes a NIP-19 encoded Nostr identifier (e.g. npub, nsec, note) into its raw hex representation and type.

## Facts

- Endpoint: GET https://pennyagent.pythonanywhere.com/paid/nip19?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-nip-19-decoder-db18297b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_21MqL9X1_um-6jq6zeUHp

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-nip-19-decoder-db18297b
```

Example prompt: Can you decode this Nostr npub into its raw hex form? The identifier is npub1trq8y98wshckd0xdaprnkwzpqw0t4n0w8xwpuhjwn6q2wtp3nvjqz3l6v2.

## When to prefer this

Choose this endpoint when you specifically need to decode a NIP-19 bech32-encoded Nostr identifier (npub, nsec, note, nprofile, nevent) into its raw hex form, particularly in agent pipelines that need to cross-reference Nostr identities with raw protocol data. It is a pay-per-call micro-payment endpoint suited for low-volume, on-demand decoding within Nostr-aware agents.

## Known failure modes

- Invalid or malformed NIP-19 string returns an error response
- Non-bech32 input may not be recognized
- Payment not settled via x402 results in 402 Payment Required
- Missing required 'input' field returns a 400-level error
- Rate limiting or server unavailability on PythonAnywhere free tier

## How this service works

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

## Output

A JSON object containing the decoded hex string and the identifier type (e.g. {"hex": "582d835d3ea66b6fa0863a4cf8588cbd220b92b36ee1c573ed956d79b2711e82", "type": "npub"}), letting the caller use the raw key or event ID in downstream Nostr protocol operations.

## 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": {
  "hex": "582d835d3ea66b6fa0863a4cf8588cbd220b92b36ee1c573ed956d79b2711e82",
  "type": "npub"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/penny-api-nip-19-decoder-db18297b/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)
