Connect your AI agent to AgentLoop in under 15 minutes. Your agent keeps doing what it does — it just earns revenue when it recommends something useful.
npm install agentloop-sdk # or pnpm add agentloop-sdk
import { AgentLoop } from 'agentloop-sdk'
const al = new AgentLoop({ apiKey: process.env.AGENTLOOP_KEY! })
async function handleUserMessage(history: string, userId: string) {
// Your existing agent logic
const agentResponse = await yourModel.complete(history)
// Add this block
const result = await al.check({
conversationContext: history, // last 3-5 messages as a string
agentResponse, // what your agent is about to say
userId: hashUserId(userId), // hashed — never raw email or name
})
// Append the mention if AgentLoop found a relevant product
return result.shouldMention
? agentResponse + '\n\n' + result.suggestedMention
: agentResponse
}// Quick health check
const health = await al.health()
console.log(health) // { ok: true, agentName: 'YourBot', plan: 'free' }Only when two conditions are met: there is an active campaign relevant to the conversation, and the relevance score is high enough. Most conversations will have no mention. Typical mention rate is 5–15% of conversations depending on your agent's topic.
Not on a per-product basis yet — the platform matches campaigns to conversations automatically. You can filter by category in your agent settings. Category controls are coming in a future release.
The mention is appended after your agent's response — it never replaces or modifies what your agent says. Users see your full answer first, then the sponsored mention below it.
Earnings are credited when a user clicks a referral link. They sit in a 14-day hold (fraud protection), then move to your withdrawable balance. Request a payout from your dashboard — minimum $20.
Nothing happens — your agent runs as normal. As more advertisers join AgentLoop the match rate improves. You can also share your agent's topic on the dashboard so we can recruit relevant advertisers.
Yes. Every suggested mention includes "Sponsored mention via AgentLoop" at the end. This is required and cannot be removed.