Install the SDK
Add the TypeScript, Go, or Python package plus buyer dependencies for your runtime. Each language ships buyer modules and a control-plane client from the same repository.
TypeScript, Go, and Python packages mirror the control-plane OpenAPI contract and include buyer clients for paying gateway hostnames. CLI and MCP tooling extend the same APIs for scripts and agents.
Workflow
Whether you ship a backend service, an agent, or a CI job, the SDK path is the same — install, pay a gateway URL, then automate dashboard tasks with scoped keys.
Add the TypeScript, Go, or Python package plus buyer dependencies for your runtime. Each language ships buyer modules and a control-plane client from the same repository.
Point buyer clients at a priced hostname. Unpaid requests return HTTP 402 with machine-readable payment requirements the SDK can parse and sign.
The client signs the authorization, settles through the gateway facilitator path, and retries with PAYMENT-SIGNATURE until upstream returns 200.
Use the main SDK entry with scoped API keys to manage APIs, endpoints, domains, and analytics from CI pipelines or agent workflows.
Capabilities
Buyer clients for gateway URLs, control-plane automation for sellers, and terminal plus MCP surfaces for developers and agents.
TypeScript, Go, and Python modules share the same pay-and-fetch flow against gateway hostnames — from apps, agents, and scripts.
Mirror the seller OpenAPI contract for APIs, endpoints, domains, and keys. Same routes the dashboard uses, callable from code.
Inspect gateway URLs, pay from the terminal, and run shell commands in the dashboard workbench for interactive debugging.
Expose control-plane and buyer actions as agent tools for Cursor and compatible hosts — built from the SDK repository.
Automate with keys limited to the scopes you choose — read stats, write endpoints, manage domains, and run buyer flows.
Buyer clients handle exact and batch-settlement schemes returned by the facilitator, including 402 challenge parsing and retries.
Languages
Each language ships buyer modules and a control-plane client. Install the package, pay a staging echo URL, then wire automation with scoped API keys.
Control-plane CRUD, buyer client, browser automation
Install
pnpm add @axlabs/ax402-sdk
# Buyer deps
pnpm add @x402/fetch @x402/evm viemBuyer example
import { buyerClientFromEnv } from "@axlabs/ax402-sdk/buyer";
const client = await buyerClientFromEnv();
const { response } = await client.pay({
url: "https://echo.staging.ax402.io/echo/get?test=1",
});CI/CD, gateway automation, buyer flows
Install
go get github.com/AxLabs/ax402-sdk/goBuyer example
import "github.com/AxLabs/ax402-sdk/go/buyer"
client, _ := buyer.NewFromPrivateKey(ctx, privateKey)
resp, _ := client.Get(ctx, gatewayURL)Agents, async control plane, buyer client
Install
pip install "ax402-sdk[buyer]"Buyer example
from ax402_sdk.buyer import BuyerClient
client = BuyerClient.from_env()
response = client.get(gateway_url)Documentation
Integration guides, buyer flows, batch settlement, and agent discovery live in the docs hub.
Start with buyer clients against staging echo URLs, then wire control-plane automation with scoped API keys.