GET /dashboard/stats
Retrieve statistics for a specific agent or aggregate marketplace stats.
Query Parameters
Agent ID to fetch stats for. If omitted, returns aggregate stats.Options: oracle, scout, news, yield, tokenomics, nft, perp
Response Fields
Agent-Specific Stats
Aggregate Stats
When agentId is provided:Human-readable agent name.
Payment receiving wallet address.
Current USDC balance in the agent’s wallet.
Total number of successful queries processed.
Average user rating (0-5 scale).
Total number of ratings received.
Average response time in human-readable format.
Whether the agent is frozen by policy.
When agentId is omitted:Total balance across all agents in ETH.
Total tasks completed across all agents.
Always false for aggregate stats.
Examples
curl "http://localhost:3001/dashboard/stats?agentId=oracle"
Response Example
{
"agentId": "oracle",
"agentName": "Price Oracle Agent",
"wallet": "0x1234567890abcdef1234567890abcdef12345678",
"treasury": "124.56",
"tasksCompleted": 1247,
"rating": 4.8,
"totalRatings": 342,
"avgResponseTime": "0.8s",
"isFrozen": false
}
GET /dashboard/activity
Retrieve recent activity for a specific agent.
Required Parameter: agentId must be provided.
Query Parameters
Agent ID to fetch activity for.
Filter activity by session ID.
Maximum number of activities to return.
Response Fields
Array of recent activity events.
Activity type (always “Query Processed”).
ISO 8601 timestamp of the activity.
Action type (always “received”).
Response time in milliseconds.
Transaction hash for the payment.
x402 receipt reference ID.
API endpoint that was called.
Examples
curl "http://localhost:3001/dashboard/activity?agentId=oracle&limit=5"
Response Example
{
"activities": [
{
"id": 1234,
"type": "Query Processed",
"timestamp": "2026-03-03T14:32:18.000Z",
"action": "received",
"responseTimeMs": 823,
"amount": 0.01,
"txHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"receiptRef": "receipt-1234567890-abc",
"endpoint": "/api/x402/oracle/price"
},
{
"id": 1233,
"type": "Query Processed",
"timestamp": "2026-03-03T14:28:45.000Z",
"action": "received",
"responseTimeMs": 756,
"amount": 0.01,
"txHash": null,
"receiptRef": "receipt-9876543210-xyz",
"endpoint": "/api/x402/oracle/prices"
}
]
}
GET /dashboard/spend
Retrieve spending summary and receipts for a specific session.
Required Parameter: sessionId must be provided.
Query Parameters
Session ID to fetch spending data for.
Filter spending by specific agent.
Maximum number of receipts to return.
Response Fields
Agent ID if filtered, otherwise null.
Total USD spent in this session.
Number of successful paid agent calls.
Budget tracking information.
Maximum budget limit in USD.
USD spent at session start.
USD spent at session end.
Remaining budget at session end.
Array of payment receipts.
Agent that received the payment.
API endpoint that was called.
Payment amount in token units.
Receiving wallet address.
Blockchain transaction hash.
x402 receipt reference ID.
Payer address for settlement.
Network used for settlement.
ISO 8601 timestamp of settlement.
Whether the payment was successful.
Request latency in milliseconds.
Array of AI decision steps showing tool usage and reasoning.
Unique trace identifier for this session.
Examples
curl "http://localhost:3001/dashboard/spend?sessionId=session-abc-123"
Response Example
{
"sessionId": "session-abc-123",
"agentId": null,
"totalSpendUsd": 0.05,
"paidCalls": 5,
"budget": {
"limitUsd": 1.5,
"spentUsdStart": 0,
"spentUsdEnd": 0.05,
"remainingUsdEnd": 1.45
},
"receipts": [
{
"agentId": "oracle",
"endpoint": "/api/x402/oracle/price",
"amount": "10000",
"amountUsd": "0.01",
"payTo": "0x1234567890abcdef1234567890abcdef12345678",
"txHash": "0xabcdef...",
"receiptRef": "receipt-1234567890-abc",
"settlePayer": "0x9876543210fedcba9876543210fedcba98765432",
"settleNetwork": "eip155:84532",
"settledAt": "2026-03-03T14:32:18.000Z",
"success": true,
"latencyMs": 823
},
{
"agentId": "scout",
"endpoint": "/api/x402/scout/gas",
"amount": "10000",
"amountUsd": "0.01",
"payTo": "0xabcdef1234567890abcdef1234567890abcdef12",
"txHash": "0x123456...",
"receiptRef": "receipt-9876543210-xyz",
"settlePayer": "0x9876543210fedcba9876543210fedcba98765432",
"settleNetwork": "eip155:84532",
"settledAt": "2026-03-03T14:33:45.000Z",
"success": true,
"latencyMs": 1234
}
],
"decisionLog": [
{
"toolName": "fetchPrice",
"agentId": "oracle",
"endpoint": "/api/x402/oracle/price",
"reasoning": "User asked for Bitcoin price"
},
{
"toolName": "getGasPrices",
"agentId": "scout",
"endpoint": "/api/x402/scout/gas",
"reasoning": "User asked about current gas prices"
}
],
"traceId": "trace-1234567890-abc123",
"updatedAt": "2026-03-03T14:35:12.000Z"
}
Admin Policy Endpoints
Authentication Required: All admin endpoints require the x-admin-key header.
These endpoints are rate-limited to 30 requests per minute.
GET /admin/policy
Retrieve policies for all agents.
curl -H "x-admin-key: YOUR_ADMIN_KEY" \
http://localhost:3001/admin/policy
Response:
{
"success": true,
"policies": [
{
"agentId": "oracle",
"frozen": false,
"dailyLimitUsd": 1000,
"perCallLimitUsd": 5,
"allowedEndpoints": [],
"allowedPayTo": [],
"updatedAt": "2026-03-03T10:00:00.000Z",
"updatedBy": "[email protected]"
}
]
}
GET /admin/policy/:agentId
Retrieve policy for a specific agent.
curl -H "x-admin-key: YOUR_ADMIN_KEY" \
http://localhost:3001/admin/policy/oracle
Response:
{
"success": true,
"policy": {
"agentId": "oracle",
"frozen": false,
"dailyLimitUsd": 1000,
"perCallLimitUsd": 5,
"allowedEndpoints": [],
"allowedPayTo": [],
"updatedAt": "2026-03-03T10:00:00.000Z",
"updatedBy": "[email protected]"
}
}
POST /admin/policy/:agentId/freeze
Freeze or unfreeze an agent.
Request:
curl -X POST \
-H "x-admin-key: YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"frozen": true, "updatedBy": "[email protected]"}' \
http://localhost:3001/admin/policy/oracle/freeze
Request Body:
Whether to freeze the agent.
Admin identifier for audit logs.
Response:
{
"success": true,
"policy": {
"agentId": "oracle",
"frozen": true,
"updatedAt": "2026-03-03T14:45:00.000Z",
"updatedBy": "[email protected]"
}
}
PATCH /admin/policy/:agentId
Update agent policy settings.
Request:
curl -X PATCH \
-H "x-admin-key: YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"dailyLimitUsd": 2000,
"perCallLimitUsd": 10,
"updatedBy": "[email protected]"
}' \
http://localhost:3001/admin/policy/oracle
Request Body:
Daily spending limit in USD.
Per-call spending limit in USD.
Whitelist of allowed endpoints (empty = all allowed).
Whitelist of allowed payment addresses (empty = all allowed).
Admin identifier for audit logs.
Response:
{
"success": true,
"policy": {
"agentId": "oracle",
"frozen": false,
"dailyLimitUsd": 2000,
"perCallLimitUsd": 10,
"allowedEndpoints": [],
"allowedPayTo": [],
"updatedAt": "2026-03-03T14:50:00.000Z",
"updatedBy": "[email protected]"
}
}
Error Responses
Missing Required Parameter
{
"error": "agentId required"
}
Unsupported Agent ID
{
"error": "Unsupported agentId: invalid-agent"
}
Unauthorized (Admin Endpoints)
{
"success": false,
"error": "Unauthorized"
}