{
    "ok": true,
    "name": "OPUB API Gateway",
    "version": "1.1-ready",
    "base_url": "https://api.dobruk.pl",
    "note": "Proxy layer for OPUB endpoints. Configure upstream with OPUB_UPSTREAM_BASE.",
    "routes": [
        {
            "path": "/opub/list.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/list",
            "description": "Lista publikacji OPUB (feed).",
            "usage": "GET /opub/list.php?limit=20&offset=0"
        },
        {
            "path": "/opub/tx.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/tx",
            "description": "Szczegóły tokena po TXID (manifest + zdekodowane dane).",
            "usage": "GET /opub/tx.php?txid={txid}"
        },
        {
            "path": "/opub/mint.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/mint",
            "description": "Mint pojedynczego tokena OPUB.",
            "usage": "POST /opub/mint.php (JSON body, Content-Type: application/json)"
        },
        {
            "path": "/opub/mint-batch.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/mint-batch",
            "description": "Mint wielu tokenów w batchu.",
            "usage": "POST /opub/mint-batch.php (JSON body)"
        },
        {
            "path": "/opub/onchain.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/onchain",
            "description": "Zapis metadanych publikacji on-chain w bazie serwisu.",
            "usage": "POST /opub/onchain.php (JSON body)"
        },
        {
            "path": "/opub/store.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/store",
            "description": "Techniczny zapis rekordu/payloadu w storage serwisu.",
            "usage": "POST /opub/store.php (JSON body)"
        },
        {
            "path": "/opub/fee-hint.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/fee-hint",
            "description": "Podpowiedź opłat (fee) do mintowania.",
            "usage": "GET /opub/fee-hint.php?network=main"
        },
        {
            "path": "/opub/funds-check.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/funds-check",
            "description": "Sprawdzenie, czy adres ma środki na mint/fee.",
            "usage": "POST /opub/funds-check.php (JSON: address/network)"
        },
        {
            "path": "/opub/draft.php",
            "methods": [
                "GET",
                "POST",
                "DELETE"
            ],
            "upstream": "/api/opub/draft",
            "description": "CRUD pojedynczego szkicu.",
            "usage": "GET /opub/draft.php?id={id} | POST /opub/draft.php | DELETE /opub/draft.php?id={id}"
        },
        {
            "path": "/opub/drafts.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/drafts",
            "description": "Lista szkiców użytkownika.",
            "usage": "GET /opub/drafts.php?limit=20&offset=0"
        },
        {
            "path": "/opub/documents/drafts.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/documents/drafts",
            "description": "Lista szkiców dokumentów.",
            "usage": "GET /opub/documents/drafts.php?limit=20&offset=0"
        },
        {
            "path": "/opub/documents/onchain.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/documents/onchain",
            "description": "Pobranie dokumentu on-chain po identyfikatorze.",
            "usage": "GET /opub/documents/onchain.php?txid={txid}"
        },
        {
            "path": "/opub/documents/visibility.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/documents/visibility",
            "description": "Zmiana widoczności dokumentu.",
            "usage": "POST /opub/documents/visibility.php (JSON: id, visibility)"
        },
        {
            "path": "/opub/video-stream.php?txid={txid}",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/video-stream/{txid}",
            "description": "Strumień wideo NFT (obsługuje Range/Partial Content).",
            "usage": "GET /opub/video-stream.php?txid={txid}&network=main"
        },
        {
            "path": "/opub/audio-stream.php?txid={txid}",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/audio-stream/{txid}",
            "description": "Strumień audio NFT (obsługuje Range/Partial Content).",
            "usage": "GET /opub/audio-stream.php?txid={txid}&network=main"
        },
        {
            "path": "/opub/tips/top.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/tips/top",
            "description": "Top tokenów wg napiwków.",
            "usage": "GET /opub/tips/top.php?limit=20"
        },
        {
            "path": "/opub/tips/summary.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/tips/summary",
            "description": "Podsumowanie napiwków (globalne).",
            "usage": "GET /opub/tips/summary.php"
        },
        {
            "path": "/opub/tips/summary-token.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/tips/summary-token",
            "description": "Podsumowanie napiwków dla konkretnego tokena.",
            "usage": "GET /opub/tips/summary-token.php?txid={txid}"
        },
        {
            "path": "/opub/tips/record.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/tips/record",
            "description": "Zapis zdarzenia napiwku.",
            "usage": "POST /opub/tips/record.php (JSON body)"
        },
        {
            "path": "/opub/tips/list-token.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/tips/list-token",
            "description": "Lista napiwków dla tokena.",
            "usage": "GET /opub/tips/list-token.php?txid={txid}&limit=50"
        },
        {
            "path": "/opub/tip/handcash.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/tip/handcash",
            "description": "Inicjacja napiwku przez HandCash.",
            "usage": "POST /opub/tip/handcash.php (JSON body)"
        },
        {
            "path": "/opub/reactions/top.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/reactions/top",
            "description": "Top tokenów wg reakcji.",
            "usage": "GET /opub/reactions/top.php?limit=20"
        },
        {
            "path": "/opub/reactions/summary-token.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/reactions/summary-token",
            "description": "Podsumowanie reakcji dla tokena.",
            "usage": "GET /opub/reactions/summary-token.php?txid={txid}"
        },
        {
            "path": "/opub/reactions/set.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/reactions/set",
            "description": "Ustawienie/zmiana reakcji użytkownika.",
            "usage": "POST /opub/reactions/set.php (JSON body)"
        },
        {
            "path": "/opub/visits/top.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/visits/top",
            "description": "Top tokenów wg odwiedzin.",
            "usage": "GET /opub/visits/top.php?limit=20"
        },
        {
            "path": "/opub/visits/summary-token.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/visits/summary-token",
            "description": "Podsumowanie odwiedzin dla tokena.",
            "usage": "GET /opub/visits/summary-token.php?txid={txid}"
        },
        {
            "path": "/opub/visits/record.php",
            "methods": [
                "POST"
            ],
            "upstream": "/api/opub/visits/record",
            "description": "Zapis zdarzenia odwiedzin tokena.",
            "usage": "POST /opub/visits/record.php (JSON body)"
        },
        {
            "path": "/opub/suggest.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/suggest",
            "description": "Podpowiedzi (autocomplete/suggestions).",
            "usage": "GET /opub/suggest.php?q={fraza}"
        },
        {
            "path": "/opub/random-tx.php",
            "methods": [
                "GET"
            ],
            "upstream": "/api/opub/random-tx",
            "description": "Losowy TXID z kolekcji OPUB.",
            "usage": "GET /opub/random-tx.php"
        }
    ]
}