> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solvapay.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> SolvaPay quick facts:
> - REST API base URL: https://api.solvapay.com. All public endpoints are under /v1/sdk/ (for example GET https://api.solvapay.com/v1/sdk/products). Sandbox and production share this URL.
> - Auth: send a secret key as `Authorization: Bearer <secret key>` (the REST API also accepts `X-API-Key: <secret key>`).
> - Secret key prefixes: `sk_sandbox_` (sandbox, test payments) and `sk_live_` (production). The prefix selects the environment.
> - Get keys in SolvaPay Console (https://app.solvapay.com) > Developers > API Keys. Use a sandbox key while building.
> - Admin MCP Server: https://mcp.solvapay.com/mcp (Streamable HTTP). Connect with OAuth: add the URL and sign in with the SolvaPay account; no API key needed. OAuth sessions use the live account; for sandbox data or headless clients, send `Authorization: Bearer <secret key>` (X-API-Key is ignored).
> - Install the SolvaPay agent skills: `npx skills add https://solvapay.com` (skills CLI older than 1.5.7: `npx skills add solvapay/skills`).
> - TypeScript SDK setup: `npx solvapay@latest init`. The SDK reads SOLVAPAY_SECRET_KEY and defaults to https://api.solvapay.com.
> - Plans take an options[] array (billingCycle, charge, limit, ...). Retired plan fields price, freeUnits and billingCycle are rejected.
> - Step-by-step from zero to a first paid call: Managed MCP https://docs.solvapay.com/build/managed-mcp.md, TypeScript SDK https://docs.solvapay.com/build/typescript-sdk.md, agent skill https://docs.solvapay.com/build/agent-skill.md.
> - Details: https://docs.solvapay.com/api-reference/authentication.md. OpenAPI spec: https://docs.solvapay.com/api-reference/openapi.json.

# Go SDK

> Charge for Go functions, MCP tools and agent calls with the SolvaPay Go SDK.

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](https://github.com/modelcontextprotocol/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](https://docs.solvapay.com/sdks/typescript/intro.md) on every change by a shared conformance suite. The API client is generated from the same API spec.

## Next steps

| Page | What it covers |
| - | - |
| [Installation](https://docs.solvapay.com/sdks/go/setup/installation.md) | Install the module, set your keys, pick a version |
| [Quick start](https://docs.solvapay.com/sdks/go/setup/quick-start.md) | Make a function paid and serve it over HTTP |
| [MCP server](https://docs.solvapay.com/sdks/go/guides/mcp.md) | Paid MCP tools, sign-in and the checkout widget |
| [API client](https://docs.solvapay.com/sdks/go/guides/api-client.md) | Call the SolvaPay API and handle its errors |
| [Webhooks](https://docs.solvapay.com/sdks/go/guides/webhooks.md) | Receive and verify webhook events |
| [React web checkout](https://docs.solvapay.com/sdks/go/guides/react-web-checkout.md) | Serve the routes the `@solvapay/react` components call |
| [Agent payments](https://docs.solvapay.com/sdks/go/guides/agents.md) | Let agents pay for your MCP tools (preview) |
| [Examples](https://docs.solvapay.com/sdks/go/guides/examples.md) | Run the Go stock research MCP server |

The full API reference is on [pkg.go.dev](https://pkg.go.dev/github.com/solvapay/solvapay-sdk/go).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.