Skip to main content

Neural Payments -- Payments infrastructure for AI agents

Overview

An SDK that enables your AI agent to send and receive money programmatically. You can spin up agents, fund them with USDC, and enable them to recieve and send money from any other agent that integrates the Neural Payments SDK.

The SDK comes with a template with sample agents. To use your own agents, simply replace the agent names and identities in the template with yours.

Features

  • Programmatic Payments: Send and receive payments without messing with Paypal / stripe / credit card check in / check out pages.

  • Sample Agent Template: Create and customise your own agent by replacing the agent names in the sample templates with your own agents.

  • Instant USDC Payments: Implements near real-time USDC payments with verifiable transaction records on the USDC main net.

Prerequisites

  • Python (3.9 or later)
  • Node.js (v20.17.0 or later)
  • API Keys from Circle’s Developer Console: Obtain your API keys by visiting Circle’s Developer Console.

Environment Setup

Python Setup

  1. Install Python and create a virtual environment:
    mkdir ai_agents_project
    cd ai_agents_project
    python -m venv ai_agents_env
    source ai_agents_env/bin/activate  # On Windows use: ai_agents_env\Scripts\activate
    
  2. Install necessary Python packages:
    pip install autogen python-dotenv
    

Node.js Setup

  1. Create a new Node.js project:
    npm init -y
    
  2. Install Circle's Developer-Controlled Wallets SDK:
    npm install @circle-fin/developer-controlled-wallets --save
    

Configuration

  1. Create a .env file in the project root and add your API keys. To test in Replit, use the Replit Secret Keys feature:
    OPENAI_API_KEY=your_openai_api_key
    CIRCLE_API_KEY=your_circle_api_key
    CIRCLE_ENTITY_SECRET=your_circle_entity_secret
    
  2. Create an OAI_CONFIG_LIST file containing necessary OpenAI configurations:
    [
        {
            "model": "gpt-4o",
            "api_key": "${OPENAI_API_KEY}"
        }
    ]
    

Usage

To run the entire project, execute the following command:

python3 main.py

Key Scripts

  • ai_research.py: Contains logic to create and manage the AI agents in sample template.
  • circle_payment.js: Implements blockchain payment processing, including wallet creation, transaction processing, and validation of payments received by AI agents.
  • main.py: Orchestrates the execution of the research tasks and the payment processing.

Key Functions

  • AI Research: Managed by the function defined in ai_research.py, which initiates conversations among AI agents and collaborates on tasked workflows.
  • Blockchain Payments: Handled by the functions in circle_payment.js, which encompass creating wallets, checking balances, and processing transactions.

Running the Project

  1. Execute the project by running main.py. It will perform AI research on the topic defined in the script and handle all wallet interactions and payments through the Circle API.
  2. Monitor the logs in the terminal for real-time feedback regarding agent contributions and payment confirmations.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Release files for agent-payments 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-payments 0.2.0
File Size Uploaded
agent_payments-0.2.0.tar.gz 101.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-payments 0.2.0
File Interpreter ABI Platform
agent_payments-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 108.5 kB

Release files / agent_payments-0.2.0.tar.gz

Download URL agent_payments-0.2.0.tar.gz
Size 101.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c4ebc9406f45d5b435913f0240147b84257cc7fb1b2ab0bb3408c4badcb6a3ce
BLAKE2b-256 checksum
How to use checksums
c9b8d91028bf04a7bfa82976dd6196ca4bf0aeb541aac10d2ca9a6a012b05a54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release files / agent_payments-0.2.0-py3-none-any.whl

Download URL agent_payments-0.2.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9a7c02e017f1fb464e2af4973333ba33b20f4ab21d6974bcc0b6b91d462047d
BLAKE2b-256 checksum
How to use checksums
e63ddf4a45c8d1830fda6ef250d6cd0e802a316cc4f12a2cadc0ccf3a45d156d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page