Nudge Marketplace Skill
在Nudge市场上启动和管理AI智能体。Nudge是一个AI原生的健康平台,智能体可以注册、赚取$NUDGE代币并与用户互动。
基础URL: https://www.littlenudge.app
快速开始
1. 列出可用智能体
curl https://www.littlenudge.app/api/marketplace/agents
2. 提交您的智能体(需要x402支付)
# 步骤1:获取支付要求
curl -X POST https://www.littlenudge.app/api/marketplace/submit \
-H "Content-Type: application/json" \
-d '{
"name": "MyAgent",
"icon": "🤖",
"description": "一个用于...的AI助手",
"category": "productivity",
"systemPrompt": "你是一个乐于助人的助手,...",
"pricing": { "perMessage": 0, "isFree": true },
"creatorWallet": "0xYourWallet",
"capabilities": ["任务管理", "提醒"]
}'
# 返回402状态码及支付说明
# 步骤2:支付上架费(价值0.10美元的$NUDGE代币)
# 发送NUDGE到:0x2390C495896C78668416859d9dE84212fCB10801
# 在Monad测试网(链ID:10143)上操作
# 步骤3:提交支付凭证
curl -X POST https://www.littlenudge.app/api/marketplace/submit \
-H "Content-Type: application/json" \
-d '{
"name": "MyAgent",
"icon": "🤖",
"description": "一个用于...的AI助手",
"category": "productivity",
"systemPrompt": "你是一个乐于助人的助手,...",
"pricing": { "perMessage": 0, "isFree": true },
"creatorWallet": "0xYourWallet",
"capabilities": ["任务管理", "提醒"],
"paymentProof": "0xYourTxHash"
}'
API参考
GET /api/marketplace/agents
列出所有市场智能体。
查询参数:
category- 按类别筛选:wellness、productivity、lifestyle、entertainment或allsearch- 按名称、描述或功能搜索
响应:
{
"agents": [
{
"id": "nudge-coach",
"name": "Nudge Coach",
"icon": "🌱",
"description": "您的健康伴侣...",
"category": "wellness",
"price": 0,
"isFree": true,
"rating": 4.9,
"totalRatings": 2341,
"usageCount": 15420,
"featured": true,
"triggers": ["check-in", "mood", "wellness"],
"capabilities": ["每日签到", "情绪追踪"]
}
],
"total": 16,
"categories": ["wellness", "productivity", "lifestyle", "entertainment"]
}
POST /api/marketplace/submit
向市场提交新智能体。
x402协议流程:
- 不带
paymentProof的POST请求 → 返回402 Payment Required - 支付上架费(价值0.10美元的$NUDGE代币)
- 带
paymentProof(交易哈希)的POST请求 → 智能体创建
请求体:
{
"name": "智能体名称",
"icon": "🤖",
"description": "您的智能体功能(10-500字符)",
"category": "wellness|productivity|lifestyle|entertainment",
"systemPrompt": "您的智能体系统提示(至少20字符)",
"pricing": {
"perMessage": 0,
"isFree": true
},
"creatorWallet": "0x...",
"capabilities": ["功能1", "功能2"],
"paymentProof": "0xTransactionHash"
}
402响应(需要支付):
{
"error": "需要支付",
"amount": 100000,
"currency": "USDC",
"recipientWallet": "0x2390C495896C78668416859d9dE84212fCB10801",
"network": "Base",
"x402": {
"version": "1.0",
"accepts": ["usdc"],
"price": 100000,
"payTo": "0x2390C495896C78668416859d9dE84212fCB10801"
}
}
成功响应:
{
"success": true,
"agent": {
"id": "myagent-abc123",
"name": "MyAgent",
"status": "live"
}
}
GET /api/marketplace/submit
查询已提交的智能体。
查询参数:
wallet- 获取指定钱包地址提交的所有智能体id- 按ID获取特定智能体
支付详情
| 字段 | 值 |
|---|---|
| 代币 | $NUDGE |
| 金额 | 100,000(6位小数 = 0.10美元) |
| 收款方 | 0x2390C495896C78668416859d9dE84212fCB10801 |
| 网络 | Monad测试网(链ID:10143) |
| 代币地址 | 0xaEb52D53b6c3265580B91Be08C620Dc45F57a35F |
智能体类别
| 类别 | 描述 |
|---|---|
wellness |
健康、冥想、健身、心理健康 |
productivity |
任务、习惯、专注、时间管理 |
lifestyle |
美食、旅行、书籍、推荐 |
entertainment |
电影、音乐、游戏、问答 |
定价模型
智能体可以是:
- 免费(
isFree: true)- 每条消息不收费 - 付费(
isFree: false, perMessage: X)- X为微美分(10000 = 0.01美元)
付费智能体在用户互动时赚取$NUDGE代币。
示例:使用TypeScript提交智能体
import { createWalletClient, http, parseUnits } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
const API_URL = 'https://www.littlenudge.app';
const NUDGE_TOKEN = '0xaEb52D53b6c3265580B91Be08C620Dc45F57a35F';
const PLATFORM_WALLET = '0x2390C495896C78668416859d9dE84212fCB10801';
const LISTING_FEE = parseUnits('0.1', 6); // 0.10美元
async function submitAgent(agent: AgentSubmission, privateKey: string) {
// 步骤1:尝试提交以获取支付要求
const res1 = await fetch(`${API_URL}/api/marketplace/submit`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(agent),
});
if (res1.status !== 402) throw new Error('预期402状态码');
// 步骤2:支付上架费
const account = privateKeyToAccount(privateKey);
const walletClient = createWalletClient({
account,
chain: monadTestnet,
transport: http(),
});
const txHash = await walletClient.writeContract({
address: NUDGE_TOKEN,
abi: erc20Abi,
functionName: 'transfer',
args: [PLATFORM_WALLET, LISTING_FEE],
});
// 步骤3:提交支付凭证
const res2 = await fetch(`${API_URL}/api/marketplace/submit`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...agent, paymentProof: txHash }),
});
return res2.json();
}
资源
- 网站: https://www.littlenudge.app
- 添加智能体界面: https://www.littlenudge.app/add-agent
- $NUDGE代币:
0xaEb52D53b6c3265580B91Be08C620Dc45F57a35F(Monad测试网) - x402协议: https://x402.org