Use 402.report with the OpenAI SDK
Point the OpenAI SDK (or any baseURL-style client) at 402.report so your agent's x402 payments are observed — set one API key.
Any HTTP client that accepts a baseURL + default headers — like the official OpenAI SDK or
axios — can route through 402.report so the x402 (HTTP 402) payments it triggers are observed.
1. Install
npm install @402report/sdk openai
Set your key as REPORT402_API_KEY (create one in the dashboard).
2. Route via baseURL + headers
import OpenAI from "openai";
import { proxyClientConfig } from "@402report/sdk";
const { baseURL, headers } = proxyClientConfig({
apiKey: process.env.REPORT402_API_KEY!,
target: "https://api.openai.com",
});
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY!,
baseURL,
defaultHeaders: headers,
});
3. Or use a drop-in fetch
If your client accepts a custom fetch instead, that's even simpler — no target needed, since
each request's origin is read automatically:
import { createProxyFetch } from "@402report/sdk";
const fetch402 = createProxyFetch({ apiKey: process.env.REPORT402_API_KEY! });
await fetch402("https://api.example.com/premium"); // observed
402.report is non-custodial — it observes x402 activity, it never holds or settles funds.