Ax402Docs
GETTING STARTED

SDK integration

Control plane and buyer clients in your codebase

Use Ax402 SDKs when you need programmatic control — CI pipelines, custom admin UIs, agent workflows, or in-process buyer logic. Control-plane SDKs talk to AX402_BASE_URL; buyer SDKs pay gateway hostnames with an EVM wallet.

Packages live in github.com/AxLabs/ax402-sdks.

Control plane vs buyer

  • Control plane — manage APIs, endpoints, domains, keys, stats (seller automation). Auth: API key or JWT.
    • Buyer — pay wrapped gateway URLs from your app, agent, or script. Auth: AX402_EVM_PRIVATE_KEY or browser wallet.

Buyer quick start

Example gateway URL: https://my-api.ax402.io/v1/foo. Full guide: Buyer clients.

TypeScript

import { buyerClientFromEnv } from "@ax402/sdk/buyer";

const client = await buyerClientFromEnv();
const { response } = await client.pay({ url: "https://my-api.ax402.io/v1/foo" });

Control plane quick start

import { Ax402Client } from "@ax402/sdk";

const client = new Ax402Client({
  baseUrl: process.env.AX402_BASE_URL!,
  apiKey: process.env.AX402_API_KEY!,
});
const apis = await client.apis.list();

Go: ax402.NewClient. Python: Ax402Client.from_env().

Language guides

Automation tools

@ax402/cli and @ax402/mcp-server share the control-plane surface. Buyer: ax402 pay url and MCP ax402_pay_url.

When to use SDK integration

  • You embed seller or buyer logic in an existing application
    • You run infrastructure-as-code or CI that provisions APIs and endpoints
    • You build agents that both manage the platform and pay gateway URLs

On this page