Aslan is the universal payment infrastructure for AI agents. Enable any AI agent to make autonomous purchases with enterprise-grade security, real-time spending controls, and sub-400ms authorization.
# Install Aslan SDK
npm install @aslanpay/sdk
# Or using yarn
yarn add @aslanpay/sdk
                            const { Aslan } = require('@aslanpay/sdk');
const aslan = new Aslan({
  apiKey: process.env.ASLAN_API_KEY,
  environment: 'production' // or 'sandbox'
});
// Enable AI agent to make purchases
async function enableAIPurchases() {
  const result = await aslan.purchase({
    amount: 2500, // $25.00
    description: 'AWS credits for AI training',
    agentId: 'gpt-4-assistant'
  });
  
  console.log('Purchase successful:', result);
}
                            Aslan uses API keys for authentication. You can get your API key from the dashboard.
Authorize a payment for an AI agent.
await aslan.authorize({
  amount: 2500,           // Required: Amount in cents
  description: 'string',  // Required: Purchase description
  agentId: 'string',     // Optional: Agent identifier
  metadata: {}           // Optional: Additional data
})
                                    {
  "id": "auth_1234567890",
  "amount": 2500,
  "status": "authorized",
  "description": "AWS credits for computation",
  "created_at": "2024-01-15T10:30:00Z"
}
                                    Confirm and execute an authorized payment.
await aslan.confirm({
  authorizationId: 'auth_1234567890'
})
                                    Refund a completed payment.
await aslan.refund({
  paymentId: 'pay_1234567890',
  amount: 2500, // Optional: partial refund
  reason: 'Customer request'
})
                                    import OpenAI from 'openai'
import { Aslan } from '@aslanpay/sdk'
const openai = new OpenAI()
const aslan = new Aslan({ apiKey: process.env.ASLAN_API_KEY })
const completion = await openai.chat.completions.create({
  model: "gpt-4",
  messages: [{ role: "user", content: "Buy AWS credits" }],
  tools: [{
    type: "function",
    function: {
      name: "purchase",
      description: "Make a purchase",
      parameters: {
        type: "object",
        properties: {
          amount: { type: "number" },
          description: { type: "string" }
        }
      }
    }
  }]
})
// If AI decides to make a purchase
if (completion.choices[0].message.tool_calls) {
  const purchase = await aslan.authorize({
    amount: 2500,
    description: "AWS credits"
  })
}
                                    from langchain.tools import Tool
from aslanpay import Aslan
aslan = Aslan(api_key="your_api_key")
def purchase_tool(amount: int, description: str):
    """Make a purchase with AI agent"""
    return aslan.authorize(
        amount=amount,
        description=description
    )
purchase = Tool(
    name="purchase",
    description="Make purchases for the AI agent",
    func=purchase_tool
)
                                    const aslan = new Aslan({
  apiKey: 'your_api_key',
  limits: {
    daily: 10000,        // $100 daily limit
    perTransaction: 5000, // $50 per transaction
    velocity: {
      count: 10,         // Max 10 transactions
      window: 3600       // Per hour
    }
  }
})
                                    Get support from our team of AI and payments experts.
Issue: Tried aslanpay.com instead of aslanpay.xyz
Solution: Always use aslanpay.xyz for live demo
Local: localhost:3000 for development
Invalid Key: Ensure format is ak_live_... or ak_test_...
Test Your Key:
curl -X GET http://localhost:3000/api/v1/test \
  -H "Authorization: Bearer ak_live_your_key"
            Correct Endpoints:
POST /api/v1/authorize - Start paymentPOST /api/v1/confirm - Complete paymentPOST /api/v1/refund - Process refundGET /api/v1/test - Test API keyAlways: authorize → confirm (never single purchase)
Why: Gives AI agents time to validate before charging
// 1. Authorize
const auth = await aslan.authorize({amount: 2500, description: "..."});
// 2. Confirm  
const payment = await aslan.confirm({authorizationId: auth.id});
            Development: Use MockAslanSDK.js for testing
Production: Use real API endpoints with authentication
How to tell: Mock responses include "mock": true
401 | Missing/invalid API key | 
400 | Invalid request format | 
404 | Wrong endpoint URL | 
429 | Rate limit exceeded | 
GET /healthGET /api/v1/testPOST /api/v1/authorizenode test-api-keys.js