# Stacktree agents front-door Pay-per-publish HTML hosting for AI agents. Publish an HTML page and get back a permanent, private, shareable link. ## Pay - POST /api/publish with JSON {"html": "..."}. It returns HTTP 402 with payment terms; pay $0.50 over x402 (USDC on Base or Solana) or MPP (USDC.e on Tempo), then send the same request with the payment. No account, no card. - x402 is a signature, not a transfer: your client signs a USDC authorization and sends it in the PAYMENT-SIGNATURE header, gas is covered, and the facilitator settles it. A plain USDC transfer to the payTo address is not a payment for any request and publishes nothing. ## Pay from Node (USDC on Base) npm install @x402/fetch @x402/evm viem ```js import { wrapFetchWithPaymentFromConfig } from '@x402/fetch'; import { ExactEvmScheme } from '@x402/evm'; import { privateKeyToAccount } from 'viem/accounts'; const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY); // holds USDC on Base const payingFetch = wrapFetchWithPaymentFromConfig(fetch, { schemes: [{ network: 'eip155:8453', client: new ExactEvmScheme(account) }], }); const res = await payingFetch('https://agents.stacktr.ee/api/publish', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ html: '...' }), }); const page = await res.json(); // page.url is the link; keep page.claim_token to revise it ``` With AgentCash: npx agentcash@latest fetch https://agents.stacktr.ee/api/publish -m POST -b '{"html":"..."}' ## After publishing - Revise the page for free at the same URL: PUT https://api.stacktr.ee/sites/{id} with header Authorization: Claim and the same JSON body. Paying again makes a second page. - More: https://stacktr.ee/x402.md ## Discover - SKILL.md (every paid route, how to pay, errors): https://agents.stacktr.ee/SKILL.md - OpenAPI: https://agents.stacktr.ee/openapi.json - Main API and MCP: https://api.stacktr.ee (MCP at /mcp) - Site and docs: https://stacktr.ee