Skip to main content
The Go SDK (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 *PaywallError with the checkout link.
  • Paid MCP tools. NewMCPServer builds a server on the official MCP Go SDK. Customers sign in with SolvaPay over OAuth, and you register tools with RegisterPayable or RegisterFree. The server also adds SolvaPay’s account and activate_plan tools and the checkout widget.
  • Webhooks. VerifyWebhook checks the SV-Signature header and parses the event.
  • API client. NewClient gives you the SolvaPay SDK API: customers, balances, purchases, limits and usage.
  • Agent payments (preview). The agents package 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.