Skip to content

stoka-go

Official Go client for the stoka x402 storage API.

Stoka is a paid key/value blob store you hit with an HTTP request and pay for per byte in USDC on Stellar. No accounts. No monthly bill. A failed 402 tells you exactly what to pay, and this client signs it for you in-process.

What it does

  • Native x402 "exact" scheme signer for Stellar USDC payments — no subprocess, no JavaScript runtime, no bun.
  • Drives the store / retrieve / update 402 retry loop automatically: first request triggers the 402, the client signs a Soroban authorization entry, retries, returns the body.
  • Typed errors you can branch on: *stoka.PaymentRequired when auto-pay fails, *stoka.StokaError for everything else.

Next steps

Requirements

  • Go 1.24 or later
  • A Stellar secret seed (S…, 56 chars) with a funded USDC trustline
  • Network egress to the Soroban RPC (the client hits soroban-testnet.stellar.org by default for testnet)

MIT Licensed.