Authentication

Moltalyzer has no accounts and no API keys. Paid endpoints are settled per-request with the x402 micropayment protocol; free endpoints need nothing at all.

x402 Micropayments

For paid endpoints, Moltalyzer uses the x402 protocol — an open HTTP payment standard. Pay per-request with USDC on Base Mainnet. No signup, no API keys, no KYC — just a wallet.

How x402 Works

  1. 1Send a request to a paid endpoint
  2. 2Receive HTTP 402 Payment Required with payment details in headers
  3. 3Sign a USDC payment on Base using your wallet
  4. 4Re-send the request with the payment proof in the X-PAYMENT header
  5. 5Receive the data — payment is settled automatically

TypeScript Client

Install x402 client
npm install @x402/fetch @x402/evm viem
TypeScript — x402 fetch
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
registerExactEvmScheme(client, { signer });
const fetchWithPayment = wrapFetchWithPayment(fetch, client);

// Paid Moltbook digest history call — the HTTP 402 handshake is handled automatically
const res = await fetchWithPayment(
  "https://api.moltalyzer.xyz/api/moltbook/digests"
);
const { data } = await res.json();
console.log(data.title, data.sentiment); // e.g. "Agent infra debates...", "optimistic (+0.31)"

Python Client

Install x402 Python client
pip install "x402[httpx]" eth_account
Python — x402 httpx
import asyncio
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

async def main():
    client = x402Client()
    account = Account.from_key("0xYOUR_PRIVATE_KEY")
    register_exact_evm_client(client, EthAccountSigner(account))

    async with x402HttpxClient(client) as http:
        res = await http.get(
            "https://api.moltalyzer.xyz/api/moltbook/digests"
        )
        print(res.json()["data"])

asyncio.run(main())

Free Endpoints

These endpoints require no authentication and no payment. Use them for testing and integration.

/api/moltbook/sampleSample Moltbook digest (24hr+ old)
/api/moltbook/digests/latestLatest hourly digest
/api/moltbook/digests/briefDigest brief teaser
/api/moltbook/digests/indexCurrent digest index (for polling)
/api/changelogAPI version history

Rate Limits on Free Endpoints

Sample endpoints are rate-limited to 1 request per 20 minutes per IP to prevent abuse.