A helpful AI agent named general-test
This agent uses x402 to charge per request using USDC.
Payment configuration is read from environment variables at startup:
X402_FACILITATOR_URL— payment facilitator endpoint (shared across all networks)X402_<NETWORK>_PAY_TO— wallet address to receive payments (set to enable, remove to disable)X402_<NETWORK>_PRICE— price per request in USDC (default: 0.01)X402_<NETWORK>_NETWORK— network identifier
Available network prefixes: X402_BASE_SEPOLIA, X402_BASE, X402_SOL_DEVNET, X402_SOL.
Set X402_FACILITATOR_URL in .env to your facilitator of choice. The PayAI facilitator offers 1,000 free settlements per month. For higher volumes, create a merchant account at merchant.payai.network and set PAYAI_API_KEY_ID and PAYAI_API_KEY_SECRET in your .env. Authentication is handled automatically.
To disable payments entirely, remove all PAY_TO values from .env.
To add a network, uncomment its section in .env and set the pay-to address.
Install dependencies:
npm installCopy the example environment file and configure your API key:
cp .env.example .envEdit .env and set your OPENAI_API_KEY.
Build and run the agent:
npm run build
npm startThe agent will be available at http://localhost:3000.
Build and run with Docker:
docker build -t general-test .
docker run -p 3000:3000 -e AGENT_URL=http://your-public-url:3000 general-testSet AGENT_URL to the public URL where the agent will be reachable. This is used in the agent card for discovery by other agents and clients.