{"id":46553873,"url":"https://github.com/agentgatepay/agentgatepay-sdks","last_synced_at":"2026-03-07T04:01:28.142Z","repository":{"id":325852418,"uuid":"1102522381","full_name":"AgentGatePay/agentgatepay-sdks","owner":"AgentGatePay","description":"Official JavaScript/TypeScript and Python SDKs for AgentGatePay - Payment gateway for the agent economy. Multi-chain crypto payments (USDC,    USDT, DAI) with AP2 mandates and MCP protocol support.","archived":false,"fork":false,"pushed_at":"2025-12-11T18:23:06.000Z","size":300,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-12T22:49:29.084Z","etag":null,"topics":["agent-economy","ai-agents","ap2","ap2-mandates","autonomous-agents","base-network","blockchain","cryptocurrency","dai","ethereum","langchain","n8n","payment-gateway","usdc","x402-protocol"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AgentGatePay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-23T16:03:16.000Z","updated_at":"2025-12-11T18:23:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AgentGatePay/agentgatepay-sdks","commit_stats":null,"previous_names":["agentgatepay/agentgatepay-sdks"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/AgentGatePay/agentgatepay-sdks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentGatePay%2Fagentgatepay-sdks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentGatePay%2Fagentgatepay-sdks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentGatePay%2Fagentgatepay-sdks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentGatePay%2Fagentgatepay-sdks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgentGatePay","download_url":"https://codeload.github.com/AgentGatePay/agentgatepay-sdks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgentGatePay%2Fagentgatepay-sdks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30207390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T03:24:23.086Z","status":"ssl_error","status_checked_at":"2026-03-07T03:23:11.444Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-economy","ai-agents","ap2","ap2-mandates","autonomous-agents","base-network","blockchain","cryptocurrency","dai","ethereum","langchain","n8n","payment-gateway","usdc","x402-protocol"],"created_at":"2026-03-07T04:01:18.359Z","updated_at":"2026-03-07T04:01:28.112Z","avatar_url":"https://github.com/AgentGatePay.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AgentGatePay SDKs\n\nOfficial JavaScript/TypeScript and Python SDKs for [AgentGatePay](https://api.agentgatepay.com) - Secure multi-chain cryptocurrency payment gateway for AI agents and autonomous systems.\n\n[![npm version](https://badge.fury.io/js/agentgatepay-sdk.svg)](https://www.npmjs.com/package/agentgatepay-sdk)\n[![PyPI version](https://badge.fury.io/py/agentgatepay-sdk.svg)](https://pypi.org/project/agentgatepay-sdk/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n---\n\n## ⚠️ IMPORTANT DISCLAIMER\n\n**AgentGatePay is currently in BETA.** By using this SDK and service, you acknowledge and accept:\n\n- **Service Availability:** The service may be unavailable, suspended, or permanently shut down at any time without prior notice. No SLA or uptime guarantees.\n- **Data Loss Risk:** All data may be lost at any time without recovery. Users are solely responsible for maintaining independent backups.\n- **No Liability:** AgentGatePay is NOT LIABLE for any direct, indirect, or consequential damages including lost cryptocurrency, failed transactions, service interruptions, or loss of revenue.\n- **Financial Risk:** Blockchain transactions are irreversible. Users are solely responsible for securing private keys, API keys, and compliance with laws.\n- **No Warranty:** This SDK is provided \"AS IS\" without warranties of any kind.\n\n**📄 Read the full [DISCLAIMER.md](DISCLAIMER.md) before using.**\n\n**BY USING THIS SDK, YOU AGREE TO THESE TERMS.**\n\n---\n\n## Overview\n\nAgentGatePay enables AI agents to make and accept cryptocurrency payments with multi-chain support (Ethereum, Base, Polygon, Arbitrum) for stablecoins (USDC, USDT, DAI).\n\n**Key Features:**\n- 🤖 Built for AI agents and autonomous systems\n- 🛡️ **AIF (Agent Interaction Firewall)** - First firewall built for AI agents\n- ⛓️ Multi-chain support (Ethereum, Base, Polygon, Arbitrum)\n- 💰 Multiple stablecoins (USDC on all chains, USDT/DAI on most)\n- 🔐 AP2 mandate protocol for budget-controlled payments\n- 🔌 MCP (Model Context Protocol) integration\n- 📊 Real-time analytics and webhooks\n- ⚡ Sub-5 second payment verification\n\n**Gateway Commission:** 0.5% fee on all payments\n- Automatically deducted via two-transaction model\n- Commission TX: 0.5% → AgentGatePay wallet (covers infrastructure costs)\n- Merchant TX: 99.5% → seller wallet\n- Both transactions atomic and transparent on-chain\n\n## SDKs\n\n### JavaScript/TypeScript SDK\n\n**Installation:**\n```bash\nnpm install agentgatepay-sdk\n```\n\n**Quick Start:**\n```typescript\nimport { AgentGatePay } from 'agentgatepay-sdk';\n\nconst client = new AgentGatePay({\n  apiKey: 'pk_live_...',\n  apiUrl: 'https://api.agentgatepay.com'\n});\n\n// Issue a mandate (budget tracks spending in USD equivalent)\nconst mandate = await client.mandates.issue(\n  'my-agent-123',                           // subject\n  100.0,                                    // budget in USD (tracks value across USDC/USDT/DAI)\n  'resource.read,payment.execute',          // scope\n  1440                                      // ttl_minutes\n);\n\n// Make a payment (client pays in stablecoins: USDC, USDT, or DAI)\nconst payment = await client.payments.submitTxHash(\n  mandate.mandateToken,                     // mandate token\n  '0x...',                                  // blockchain tx_hash (client sends USDC/USDT/DAI)\n  undefined,                                // tx_hash_commission (optional)\n  'base',                                   // chain (ethereum, base, polygon, arbitrum)\n  'USDC'                                    // token (USDC, USDT, or DAI)\n);\n```\n\n📚 **[Full JavaScript Documentation](./javascript/README.md)**\n\n---\n\n### Python SDK\n\n**Installation:**\n```bash\npip install agentgatepay-sdk\n```\n\n**Quick Start:**\n```python\nfrom agentgatepay_sdk import AgentGatePay\n\nclient = AgentGatePay(\n    api_key='pk_live_...',\n    api_url='https://api.agentgatepay.com'\n)\n\n# Issue a mandate (budget tracks spending in USD equivalent)\nmandate = client.mandates.issue(\n    subject='my-agent-123',\n    budget=100.0,                            # budget in USD (tracks value across USDC/USDT/DAI)\n    scope='resource.read,payment.execute',\n    ttl_minutes=1440\n)\n\n# Make a payment (client pays in stablecoins: USDC, USDT, or DAI)\npayment = client.payments.submit_tx_hash(\n    mandate=mandate['mandateToken'],         # mandate token\n    tx_hash='0x...',                         # blockchain tx_hash (client sends USDC/USDT/DAI)\n    chain='base',                            # chain (ethereum, base, polygon, arbitrum)\n    token='USDC'                             # token (USDC, USDT, or DAI)\n)\n```\n\n📚 **[Full Python Documentation](./python/README.md)**\n\n---\n\n## Features by Module\n\n| Module | JavaScript | Python | Description |\n|--------|------------|--------|-------------|\n| **Auth** | ✅ | ✅ | User signup, API key management, wallet management |\n| **Mandates** | ✅ | ✅ | Issue and verify AP2 budget mandates |\n| **Payments** | ✅ | ✅ | Submit payments, verify transactions, payment history |\n| **Webhooks** | ✅ | ✅ | Configure payment notifications |\n| **Analytics** | ✅ | ✅ | Revenue tracking, spending analytics |\n| **MCP Tools** | ✅ | ✅ | Model Context Protocol integration |\n| **Audit** | ✅ | ✅ | Access audit logs and transaction history |\n\n---\n\n## Supported Chains \u0026 Tokens\n\n| Token | Ethereum | Base | Polygon | Arbitrum |\n|-------|----------|------|---------|----------|\n| **USDC** | ✅ (6 decimals) | ✅ (6 decimals) | ✅ (6 decimals) | ✅ (6 decimals) |\n| **USDT** | ✅ (6 decimals) | ❌ | ✅ (6 decimals) | ✅ (6 decimals) |\n| **DAI** | ✅ (18 decimals) | ✅ (18 decimals) | ✅ (18 decimals) | ✅ (18 decimals) |\n\n**Chain Details:**\n- **Ethereum** (Chain ID: 1) - Ethereum Mainnet\n- **Base** (Chain ID: 8453) - Base (USDT not supported)\n- **Polygon** (Chain ID: 137) - Polygon PoS\n- **Arbitrum** (Chain ID: 42161) - Arbitrum One\n\n---\n\n## 🛡️ Security \u0026 Rate Limits (AIF)\n\n**AIF (Agent Interaction Firewall)** is the first firewall built specifically for AI agents, protecting agents from other agents in the autonomous economy.\n\n### Rate Limits\n\n| User Type | Rate Limit | Benefits |\n|-----------|------------|----------|\n| **Anonymous** | 20 requests/min | Basic access, no signup required |\n| **With Account** | 100 requests/min | **5x more requests**, payment history, reputation tracking |\n\n**Per-Endpoint Limits:**\n- `/health` - 60 requests/min\n- `/mandates/issue` - 20 requests/min\n- `/x402/resource` - 60 requests/min\n- User signup - 5 per hour per IP\n\n**Rate limit headers** (RFC 6585 compliant):\n```\nX-RateLimit-Limit: 100\nX-RateLimit-Remaining: 95\nX-RateLimit-Reset: 1234567890\nRetry-After: 42\n```\n\n### Security Features\n\n**1. Distributed Rate Limiting**\n- ✅ Production-ready distributed counters\n- ✅ Enforced across all server instances\n- ✅ 1-minute fixed windows with automatic TTL cleanup\n- ✅ Graceful degradation (fails open on errors)\n\n**2. Replay Protection**\n- ✅ TX-hash based nonces (cryptographically unique)\n- ✅ 24-hour TTL on used nonces\n- ✅ Prevents double-spending at API level\n- ✅ Automatic detection: uses `tx_hash` or explicit `nonce`\n\n**3. Agent Reputation System** (Enabled by default)\n- Score range: **0-200** (new agents start at 100)\n- Blocking thresholds:\n  - **0-30**: ❌ Blocked (bad actor)\n  - **31-60**: ⚠️ Warning (suspicious)\n  - **61-200**: ✅ Allowed (good standing)\n- Real-time tracking of agent behavior\n- Fail-open design (errors never break payments)\n- Manual override available for false positives\n\n**4. Mandatory Mandates** (Breaking change Nov 2024)\n- ⚠️ All payments MUST have an AP2 mandate\n- Budget tracking and enforcement\n- Scope validation (permissions)\n- Prevents unauthorized payments\n\n### How to Increase Limits\n\n**Create a free account** to get 5x more requests:\n\n```typescript\n// JavaScript\nconst user = await client.auth.signup({\n  email: 'agent@example.com',\n  password: 'secure_password',\n  account_type: 'agent' // or 'merchant' or 'both'\n});\n\n// Auto-generated API key (shown once)\nconsole.log(user.api_key); // pk_live_abc123...\n```\n\n```python\n# Python\nuser = client.auth.signup(\n    email='agent@example.com',\n    password='secure_password',\n    account_type='agent'  # or 'merchant' or 'both'\n)\n\n# Auto-generated API key (shown once)\nprint(user['api_key'])  # pk_live_abc123...\n```\n\n**Then use your API key:**\n```typescript\nconst client = new AgentGatePayClient({\n  apiKey: 'pk_live_abc123...',  // ← 100 requests/min\n  baseUrl: 'https://api.agentgatepay.com'\n});\n```\n\n### Handling Rate Limits\n\n**Best Practices:**\n1. **Check response headers** for remaining quota\n2. **Implement exponential backoff** on 429 errors\n3. **Cache mandate tokens** (reuse for multiple payments)\n4. **Respect `Retry-After` header**\n\n**Example:**\n```typescript\ntry {\n  const mandate = await client.mandates.issue({...});\n} catch (error) {\n  if (error.status === 429) {\n    const retryAfter = error.headers['retry-after'];\n    console.log(`Rate limited. Retry after ${retryAfter} seconds`);\n    await sleep(retryAfter * 1000);\n    // Retry...\n  }\n}\n```\n\n---\n\n## Framework Integration Guides\n\n- **LangChain**: Coming soon\n- **AutoGPT**: Coming soon\n- **CrewAI**: Coming soon\n- **Vercel AI SDK**: Coming soon\n- **Semantic Kernel**: Coming soon\n- **AutoGen**: Coming soon\n- **Claude Desktop (MCP)**: Coming soon\n\n---\n\n## API Documentation\n\n- **REST API**: https://api.agentgatepay.com\n- **MCP Endpoint**: https://mcp.agentgatepay.com\n- **Dashboard**: https://api.agentgatepay.com/dashboard\n\n---\n\n## Examples\n\nCheck out the [agentgatepay-examples](https://github.com/AgentGatePay/agentgatepay-examples) repository for integration examples with popular AI frameworks.\n\n---\n\n## Development\n\n### JavaScript SDK\n\n```bash\ncd javascript\nnpm install\nnpm run build\nnpm test\n```\n\n### Python SDK\n\n```bash\ncd python\npip install -e \".[dev]\"\npytest\nblack agentgatepay_sdk/\nmypy agentgatepay_sdk/\n```\n\n---\n\n## Publishing\n\n### JavaScript/TypeScript\n\n```bash\ncd javascript\nnpm version patch|minor|major\nnpm run build\nnpm publish\n```\n\n### Python\n\n```bash\ncd python\npython setup.py sdist bdist_wheel\ntwine upload dist/*\n```\n\n---\n\n## Support\n\n- **GitHub Issues**: [AgentGatePay/agentgatepay-sdks](https://github.com/AgentGatePay/agentgatepay-sdks/issues)\n- **Examples Repository**: [AgentGatePay/agentgatepay-examples](https://github.com/AgentGatePay/agentgatepay-examples)\n- **Email**: support@agentgatepay.com\n\n---\n\n## License\n\nMIT License - see [LICENSE](./javascript/LICENSE) for details.\n\n---\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.\n\n---\n\n**Built for the agent economy** 🤖⚡💰\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentgatepay%2Fagentgatepay-sdks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentgatepay%2Fagentgatepay-sdks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentgatepay%2Fagentgatepay-sdks/lists"}