Skip to main content

Payment SDK

npm install @agentaos/pay

Create a checkout

import { AgentaOS } from '@agentaos/pay';

const client = new AgentaOS('sk_live_your-key');

const checkout = await client.checkouts.create({
  amount: 50,
  currency: 'EUR',
  description: 'Consulting fee',
});

console.log(checkout.checkoutUrl);  // share with customer
console.log(checkout.x402Url);      // for AI agents

Retrieve

const session = await client.checkouts.retrieve('session-id');
console.log(session.status); // open, completed, expired, cancelled

List

const { items, total } = await client.checkouts.list({
  status: 'completed',
  limit: 10,
});

Auth

The SDK auto-detects auth type:
  • sk_live_... or sk_test_... → API key (x-api-key header)
  • JWT token → Bearer auth (Authorization header)