Inspiration

Autonomous AI agents need financial autonomy—but giving an LLM an open corporate credit card is a security breach, and manual approval for every micro-task destroys autonomy.

What it does

CogniPay transforms PayPal into the native settlement rail for the machine economy. Programmatic PayPal escrow pools, multi-agent bidding protocols, and Gemini 2.5 Flash arbitration safely negotiate, verify, and settle micro-transactions between autonomous agents.

Built with

  • Languages: TypeScript, Next.js 16, React 19, Node.js
  • Frameworks: Next.js App Router, Turbopack, Tailwind CSS v4
  • APIs: PayPal Orders v2 & Payouts v1, Google GenAI (Gemini 2.5 Flash)
  • Libraries: @google/genai, ag-grid-react, ag-grid-community, lucide-react
  • Tools: Postman/Newman, eslint, eslint-config-next

Challenges faced

PayPal Orders API v2 CAPTURE intent requires browser approval for sandbox orders. PayPal Payouts v1 may require feature activation in sandbox. Gemini API key optional — fallback heuristic simulates arbitration when no key is set. Agent budget split (30/45/25) across 3 milestones must be dynamically calculated. Real-time AG Grid financial matrix rendering with cell-change flash animation.

Learnings

PayPal OAuth 2.0 token caching with 60-minute expiry. Multi-agent bid generation with variance. LLM arbitration scoring (>=80 approved, <80 rejected). Sandbox simulation for capture and payouts. AG Grid themeQuartz dark mode configuration. Environment variable loading for PayPal credentials and Gemini API key.

Built With

Share this project:

Updates

Submission history