This guide walks you through monetizing your VIBE AI agent with x402 payments.
# Example configuration
x402_config:
enabled: true
pricing:
model: "per_request"
amount: "0.01"
currency: "USDC"
wallet:
address: "0x1234..." # Your Ethereum wallet
network: "ethereum"
limits:
max_requests_per_day: 10000
rate_limit_per_minute: 60
import requests
response = requests.put(
f"{VIBE_API}/agents/{agent_id}/x402-config",
headers={"Authorization": f"Bearer {token}"},
json={
"enabled": True,
"pricing": {
"model": "per_request",
"amount": "0.01",
"currency": "USDC"
},
"wallet_address": "0x1234..."
}
)
Once x402 is enabled, your agent gets a public endpoint:
https://api.vibe.airforce/x402/agents/{agent_id}/invoke
This endpoint:
402 Payment Required without valid paymentcurl -X POST https://api.vibe.airforce/x402/agents/{agent_id}/invoke \
-H "Content-Type: application/json" \
-d '{"query": "Hello"}'
# Response: 402 Payment Required
# Headers include payment instructions
from x402_client import X402Client
client = X402Client(
private_key="0x...",
network="ethereum"
)
result = await client.pay_and_call(
url=f"https://api.vibe.airforce/x402/agents/{agent_id}/invoke",
payment={"amount": "0.01", "asset": "USDC"},
data={"query": "Analyze BTC trends"}
)
print(result)
Your agent is automatically listed on x402 Bazaar when you:
Add metadata to improve discoverability:
bazaar_metadata:
category: "research"
tags: ["crypto", "defi", "analysis"]
description: "AI research analyst for DeFi tokens"
examples:
- input: "Analyze UNI token"
output: "Comprehensive analysis..."
capabilities:
- "web_search"
- "data_analysis"
- "report_generation"
Navigate to Agents > [Your Agent] > Revenue
View:
# Get revenue stats
response = requests.get(
f"{VIBE_API}/agents/{agent_id}/revenue",
headers={"Authorization": f"Bearer {token}"}
)
stats = response.json()
# {
# "total_earned": "125.50",
# "currency": "USDC",
# "transactions_count": 1247,
# "today": "5.30",
# "this_week": "42.10"
# }
Configure auto-withdraw when balance exceeds threshold:
auto_withdraw:
enabled: true
threshold: "100" # USDC
destination: "0x5678..."
| Strategy | When to Use |
|---|---|
| Low price ($0.001-0.01) | High volume, simple queries |
| Medium price ($0.01-0.10) | Standard API calls |
| High price ($0.10-1.00) | Complex analysis, long tasks |