> ## Documentation Index
> Fetch the complete documentation index at: https://ti-mm-mycompc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Live stats: API keys, credits, and gateway wallet balance

> Public transparency dashboard: total keys claimed, total credits issued, and current gateway wallet balance. Updated in real time.

Every payment flows through one wallet on-chain, so the entire economy is public. This page pulls live counters from the gateway plus the current balance from Solana mainnet.

<div id="stats-root" style={{maxWidth: "900px", margin: "2rem auto"}}>
  <div id="stats-error" style={{display: "none", padding: "1rem", borderRadius: "8px", background: "rgba(255, 92, 92, 0.08)", border: "1px solid rgba(255, 92, 92, 0.3)", color: "#ff5c5c", marginBottom: "1rem"}} />

  <div style={{display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: "1rem", marginBottom: "1rem"}}>
    <div style={{padding: "1.5rem", background: "linear-gradient(135deg, rgba(153, 69, 255, 0.12) 0%, rgba(20, 241, 149, 0.08) 100%)", border: "1px solid rgba(153, 69, 255, 0.25)", borderRadius: "10px"}}>
      <div style={{fontSize: "0.8rem", opacity: 0.65, textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: "0.5rem"}}>Total keys claimed</div>
      <div id="stat-keys" style={{fontSize: "2.25rem", fontWeight: 700, color: "#9945FF", fontFamily: "monospace"}}>—</div>
    </div>

    <div style={{padding: "1.5rem", background: "linear-gradient(135deg, rgba(20, 241, 149, 0.12) 0%, rgba(153, 69, 255, 0.08) 100%)", border: "1px solid rgba(20, 241, 149, 0.25)", borderRadius: "10px"}}>
      <div style={{fontSize: "0.8rem", opacity: 0.65, textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: "0.5rem"}}>Total credits issued</div>
      <div id="stat-credits" style={{fontSize: "2.25rem", fontWeight: 700, color: "#14F195", fontFamily: "monospace"}}>—</div>
    </div>

    <div style={{padding: "1.5rem", background: "linear-gradient(135deg, rgba(153, 69, 255, 0.12) 0%, rgba(20, 241, 149, 0.08) 100%)", border: "1px solid rgba(153, 69, 255, 0.25)", borderRadius: "10px"}}>
      <div style={{fontSize: "0.8rem", opacity: 0.65, textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: "0.5rem"}}>Gateway wallet balance</div>
      <div id="stat-balance" style={{fontSize: "2.25rem", fontWeight: 700, color: "#9945FF", fontFamily: "monospace"}}>—</div>
      <div style={{fontSize: "0.75rem", opacity: 0.55, marginTop: "0.25rem"}}>SOL on mainnet</div>
    </div>
  </div>

  <div style={{padding: "1rem", background: "rgba(255,255,255,0.02)", border: "1px solid rgba(255,255,255,0.08)", borderRadius: "8px", fontSize: "0.85rem", opacity: 0.7, textAlign: "center"}}>
    <span id="stat-updated">Loading...</span> · Refreshes every 30 seconds ·{" "}
    <a href="https://solscan.io/account/Brpc8HoPo1d3Uiyo7kbERnjMqwLJJmbWxtwxHxzar6DU" target="_blank" style={{color: "#14F195"}}>View gateway wallet on Solscan ↗</a>
  </div>
</div>

<script
  dangerouslySetInnerHTML={{__html: `
(function() {
var GATEWAY = "https://solana-pulse-gateway-1021990235790.us-central1.run.app";
var WALLET = "Brpc8HoPo1d3Uiyo7kbERnjMqwLJJmbWxtwxHxzar6DU";

function el(id) { return document.getElementById(id); }
function fmt(n) { if (n == null || isNaN(n)) return "—"; return Number(n).toLocaleString("en-US"); }
function fmtSol(n) { if (n == null || isNaN(n)) return "—"; return Number(n).toFixed(4); }

async function refresh() {
var errEl = el("stats-error"); if (errEl) errEl.style.display = "none";
try {
  var statsP = fetch(GATEWAY + "/api/stats").then(function(r) { return r.ok ? r.json() : null; }).catch(function() { return null; });
  var balP = fetch(GATEWAY + "/api/solana/balance?wallet=" + WALLET).then(function(r) { return r.ok ? r.json() : null; }).catch(function() { return null; });
  var res = await Promise.all([statsP, balP]);
  var stats = res[0]; var bal = res[1];

  if (stats) {
    el("stat-keys").textContent = fmt(stats.totalKeys);
    el("stat-credits").textContent = fmt(stats.totalCreditsIssued);
  } else {
    el("stat-keys").textContent = "—";
    el("stat-credits").textContent = "—";
    if (errEl) { errEl.style.display = "block"; errEl.textContent = "Stats endpoint not yet deployed. Add GET /api/stats to server.ts (see docs)."; }
  }

  if (bal && typeof bal.balance_sol !== "undefined") {
    el("stat-balance").textContent = fmtSol(bal.balance_sol);
  } else {
    el("stat-balance").textContent = "—";
  }

  var d = new Date();
  el("stat-updated").textContent = "Last updated: " + d.toLocaleTimeString();
} catch (e) {
  if (errEl) { errEl.style.display = "block"; errEl.textContent = "Failed to load stats: " + (e.message || e); }
}
}

function start() { refresh(); setInterval(refresh, 30000); }
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", start); else start();
})();
`}}
/>

## What each number means

* **Total keys claimed** — Every unique API key ever created by a paying wallet. A key is minted the first time a wallet sends SOL and completes the challenge/sign/claim flow. Wallets that top up on the same key do not increment this counter.
* **Total credits issued** — Sum of all paid credits granted to keys since launch. One credit = one paid endpoint call at 0.0022 SOL. Free-tier credits (50 lifetime + 15 daily per key) are not counted.
* **Gateway wallet balance** — Live SOL balance of `Brpc8HoPo1d3Uiyo7kbERnjMqwLJJmbWxtwxHxzar6DU` on mainnet, pulled directly from a Solana RPC. This is the receiving wallet for all payments.

## Why this page is public

Wallet-based payments are transparent by design. Anyone can watch the gateway wallet on Solscan and see every payment. Publishing the aggregate counters makes the same data easier to skim without leaving the docs. Nothing here reveals which wallet claimed which key.

## For developers

The stats come from a single public JSON endpoint:

```bash theme={null}
curl https://solana-pulse-gateway-1021990235790.us-central1.run.app/api/stats
```

Response shape:

```json theme={null}
{
  "totalKeys": 42,
  "totalCreditsIssued": 12500,
  "updatedAt": "2026-09-05T02:15:33.000Z"
}
```

No authentication required. Rate-limited to 100 requests per 15 minutes per IP.
