Skip to content

Add CrewAI x402 tool example - #438

Merged
M0nsxx merged 1 commit into
nirium-protocol:mainfrom
Edgadafi:feat/367-crewai-x402
Nov 22, 2026
Merged

M0nsxx merged 1 commit into
nirium-protocol:mainfrom
Edgadafi:feat/367-crewai-x402

Conversation

@Edgadafi

Copy link
Copy Markdown
Contributor

Closes #367

Adds examples/crewai-x402/: a CrewAI tool wrapping the Nirium Python SDK's x402_fetch() with max_amount_per_payment ($1 cap, stellar:testnet), and a two-agent crew where a Data scout picks the route and a Payer pays my own local x402Serve route (server/).

Testnet evidence (my own keys):

  • Seller (payTo): GDYJA25NGJWWMGTAC73LG4J2X6FCVSTC7CTVJZKT3EZSBUYM5WOKIV5Z
  • Payer: GBTBTAO3MGBSBQ6ARGHSRRJLPJ7UBI7HCGHP47DO77TJZYWPN7KSRIY5
  • Paid /paid/market-summary ($0.02): 632ebebc…3d8d
  • /paid/full-report ($2) refused before signing with X402SpendCapError (signed: false), and the crew finishes without crashing.

Tests: 15 offline tests (pytest, no network): the tool against faked HTTP, plus the crew with a scripted model for the paid and refused runs.

Pinned versions: nirium 0.12.7, crewai 1.15.44, python-dotenv 1.2.2 (crewai needs >=1.2.2), Python 3.10–3.13.

Demo video (1:09): Nirium may share this video with credit to @Edgadafi.

pr367-crewai-demo.mp4

@drips-wave

drips-wave Bot commented Nov 21, 2026

Copy link
Copy Markdown

@Edgadafi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@M0nsxx M0nsxx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted review (Claude)

Checked: CI green; testnet tx 632ebebc…3d8d is a real 0.02 USDC payment from the author's payer to the author's own x402Serve seller (GDYJA25N…), not a Nirium key; the $2 route is refused before signing; demo video attached. Approving.

@M0nsxx
M0nsxx merged commit 7c5dfb5 into nirium-protocol:main Nov 22, 2026
20 checks passed
M0nsxx pushed a commit that referenced this pull request Nov 22, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build with Nirium: an x402 payment tool for CrewAI (Python), on testnet

2 participants