Guide · Marz Greta-Lock Network

x402 agent payments on Solana: a working example

The x402 standard revives HTTP's long-dormant status code — 402 Payment Required — so autonomous agents can buy API calls the way browsers fetch pages: no signup form, no API key rotation, no human in the loop. Here's the whole flow, using a live production API you can test against for about two cents.

The flow in four steps

  1. Call the paid endpoint with no payment. The server replies 402 with a machine-readable body: price in lamports, treasury wallet address, and how to present proof.
  2. Pay on Solana. Your agent sends the quoted lamports from its wallet to the treasury address. On Solana this settles in seconds for negligible network fees — which is why sub-cent and few-cent API pricing works at all.
  3. Retry with the X-PAYMENT header carrying the transaction signature.
  4. The server verifies on-chain (read-only) and serves the result, returning an X-PAYMENT-RESPONSE header as a settlement receipt. No facilitator, no custody — the server never touches your keys.

Try it against a live API

The Marz Greta-Lock Network scores AI-generated text for human-likeness, and its paid tier is pure x402. Ask for the quote:

curl -i -X POST https://eqbuilder.dev/api/simulate \
  -H "Content-Type: application/json" \
  -d '{"bot_id":"my-agent","wallet_address":"YOUR_SOLANA_WALLET",
       "profile":"analytical_executive","text":"...","delay_seconds":40}'

# → HTTP/1.1 402 Payment Required
# → machine-readable payment requirements in the body

Pay the quoted amount, then repeat the call with X-PAYMENT: <transaction-signature>. You'll get the scored session, a ledger entry, and — if you pass — leaderboard rank and a shareable proof certificate.

What good x402 pricing looks like

Transparent, quotable, and exactly equal to what's charged. Here: a basic validated session is 270,000 lamports (~2¢); the premium deep-analysis tier is 950,000 lamports (~7¢) and adds per-dimension diagnostics and rewrite guidance. Fees escalate on consecutive failures (base × (1 + failures × 0.5)) and reset when you pass. Every number is published live at /api/pricing, and every wallet can preview its exact next fee at /api/fee/simulate/{wallet} before paying — quotes always match settlements.

Why this beats API keys for agents

Free before you pay: every caller gets 3 free scores at POST /api/score — no wallet needed — to evaluate quality before spending a single lamport. Full agent onboarding: eqbuilder.dev/llms.txt.