github.com/solvapay/solvapay-sdk/go) lets your Go server charge for what it does. It needs Go 1.26 or later.
What you can build
- Paid functions. Wrap any function with
Payable. Each call is checked against the customer’s plan first. A call that may go ahead runs and is recorded as usage. A call that may not returns a*PaywallErrorwith the checkout link. - Paid MCP tools.
NewMCPServerbuilds a server on the official MCP Go SDK. Customers sign in with SolvaPay over OAuth, and you register tools withRegisterPayableorRegisterFree. The server also adds SolvaPay’saccountandactivate_plantools and the checkout widget. - Webhooks.
VerifyWebhookchecks theSV-Signatureheader and parses the event. - API client.
NewClientgives you the SolvaPay SDK API: customers, balances, purchases, limits and usage. - Agent payments (preview). The
agentspackage lets AI agents pay for your tools with a SolvaPay agent token or agent key.
Same behaviour as the TypeScript SDK
The paywall, its messages, the MCP tools’ answers and webhook verification are checked against the TypeScript SDK on every change by a shared conformance suite. The API client is generated from the same API spec.Next steps
The full API reference is on pkg.go.dev.