You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor documentation to improve clarity and structure. Updated import paths for MCPTool and enhanced examples for x402 payments and agent creation. Added detailed system prompts and improved agent capabilities with real-time web search and scraping tools. This enhances the usability and comprehensiveness of the guides for building AI agents.
result =await agent.run("Fetch https://api.example.com/premium")
65
+
import asyncio
66
+
from spoon_ai.payments import X402PaymentService, X402PaymentRequest
67
+
68
+
# Initialize the payment service
69
+
service = X402PaymentService()
70
+
71
+
asyncdefmain():
72
+
# Create a payment request
73
+
request = X402PaymentRequest(
74
+
amount_usdc="0.01", # Amount in USDC
75
+
resource="/premium-data",
76
+
description="Access to premium data"
77
+
)
78
+
79
+
# Sign and create payment receipt
80
+
receipt =await service.sign_and_pay(request)
81
+
print(f"Payment signed: {receipt}")
82
+
83
+
asyncio.run(main())
70
84
```
71
85
86
+
> **Note:** For agent-based x402 payments, the agent handles 402 responses automatically when configured with payment capabilities. See the full examples in the x402 package for complete integration patterns.
0 commit comments