
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
sonnet-protocol-sdk
Advanced tools
Developer SDK for launching AI agents with built-in X402 micropayments on Sonnet Protocol
Launch AI agents with built-in X402 micropayments
Sonnet Protocol provides a developer SDK for launching custom AI agents with built-in payment infrastructure. Developers can brand their agents, add custom functionality, and earn 80% of payment revenue.
All payments are automatically split:
Developers can customize:
// POST /api/sdk/register
const response = await fetch('https://your-app.run.app/api/sdk/register', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
walletAddress: '0xYourWallet...',
agentName: 'My AI Agent',
mode: 'test', // or 'production'
testWalletAddress: '0xTestWallet...', // required for test mode
revenueWalletAddress: '0xRevenueWallet...' // receives 80% of payments
})
});
const { apiKey } = await response.json();
// Save your API key: sp_abc123...
import { createSonnetSDK } from '@sonnet-protocol/sdk';
const sdk = createSonnetSDK({
mode: 'test', // or 'production'
apiKey: 'sp_abc123...',
testWalletAddress: '0xTestWallet...', // required for test mode
revenueWalletAddress: '0xRevenueWallet...', // receives 80%
agentConfig: {
name: 'My AI Agent',
description: 'Custom agent that helps with...',
systemPrompt: 'You are a helpful AI agent that...',
tools: [
{
name: 'custom-tool',
description: 'Does something custom',
parameters: { /* ... */ },
handler: async (params) => {
// Your custom logic
return result;
}
}
],
brandingConfig: {
logoUrl: 'https://...',
primaryColor: '#FF6B35',
accentColor: '#F7931E'
}
}
});
const result = await sdk.processIntent(
'swap 100 USDC to ETH',
userWalletAddress
);
if (result.paymentRequired) {
// Show X402 payment modal (built-in)
// User pays $0.06 (test) or $0.30 (production)
// 80% goes to your revenue wallet
// 20% goes to Protocol Treasury
}
User pays: $0.025 per prompt
Developer receives: $0.020 (80%)
Protocol receives: $0.005 (20%)
Wallets allowed: 1 (whitelisted)
User pays: $0.05 per prompt
Developer receives: $0.04 (80%)
Protocol receives: $0.01 (20%)
Wallets allowed: Unlimited
agentConfig: {
name: 'DeFi Trader Pro',
description: 'Advanced trading agent with custom strategies',
tools: [
{ name: 'analyze-market', ... },
{ name: 'execute-strategy', ... },
{ name: 'risk-management', ... }
]
}
agentConfig: {
name: 'NFT Scout',
description: 'Find undervalued NFTs and track collections',
tools: [
{ name: 'scan-collections', ... },
{ name: 'price-analysis', ... },
{ name: 'rarity-check', ... }
]
}
agentConfig: {
name: 'Portfolio AI',
description: 'Automated portfolio rebalancing and tracking',
tools: [
{ name: 'analyze-portfolio', ... },
{ name: 'rebalance-strategy', ... },
{ name: 'risk-report', ... }
]
}
POST /api/sdk/register
GET /api/sdk/register
Headers: X-Sonnet-API-Key: sp_...
POST /api/process-intent
Headers:
X-Sonnet-API-Key: sp_...X-Sonnet-Mode: test|productionIf your agent includes swap functionality, you can set custom swap fees:
swapFeeConfig: {
feePercentage: 1.0, // 1% swap fee
feeRecipientAddress: '0xYourFeeWallet...'
}
Note: Swap fees are separate from X402 payment fees. You control 100% of swap fees.
MIT License - Build whatever you want!
FAQs
Developer SDK for launching AI agents with built-in X402 micropayments on Sonnet Protocol
We found that sonnet-protocol-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.