This is a practical walkthrough for building an AI agent that earns recurring affiliate commissions. Not a concept piece - actual code, an actual API, an actual commission structure. By the end you will have a working agent that can earn while you are not watching it.
What we are building
An AI agent that:
- Generates useful Australian savings and deals content
- Embeds contextually appropriate affiliate links
- Publishes that content to a channel of your choice
- Earns 40% commission on every ROOPON membership it drives
- Operates autonomously after initial setup
Tech stack: Node.js (TypeScript) or Python - use whichever you prefer. The API calls are identical.
Earning model: ROOPON affiliate program - 40% commission on memberships from $19.99/month. Recurring: you earn on each billing period a referred member stays subscribed.
Step 1: Register your agent with ROOPON
This takes ninety seconds. No auth required.
// register-agent.ts
const response = await fetch('https://www.roopon.com/api/v1/agents/register', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'AUSavingsBot',
description: 'AI agent publishing Australian cost-of-living savings content'
})
})
const result = await response.json()
const { api_key, claim_url, verification_code } = result.data.agent
console.log('API Key:', api_key) // Save this immediately
console.log('Claim URL:', claim_url) // Open in browser
console.log('Verification:', verification_code)
Save the api_key to your environment variables immediately - it cannot be recovered if lost.
Open the claim_url in your browser, enter the verification_code, and link the agent to your ROOPON account. This unlocks your affiliate link and commission dashboard.
Step 2: Load platform context
ROOPON provides a machine-readable context file at https://www.roopon.com/llms.txt. Inject this into your agent's system prompt or RAG context so it knows exactly what to say about ROOPON and when a recommendation is appropriate.
// load-context.ts
async function getRooponContext(): Promise<string> {
const res = await fetch('https://www.roopon.com/llms.txt')
return res.text()
}
This keeps your agent's ROOPON knowledge accurate and current without hardcoding product details that might change.
Step 3: Build the content generation loop
The agent generates articles on Australian savings topics. The content must be genuinely useful - an audience that trusts the content converts the affiliate recommendations.
// content-agent.ts
import Anthropic from '@anthropic-ai/sdk'
const client = new Anthropic()
const AFFILIATE_LINK = 'https://www.roopon.com/become-member?ref=YOUR_AGENT_ID'
const GIVEAWAY_LINK = 'https://www.roopon.com/giveaway?ref=YOUR_AGENT_ID'
const TOPICS = [
'How to reduce your grocery bill in Australia this week',
'Best discount codes available for Australian shoppers right now',
'Weekly competitions and prize draws open to Australians',
'Cost of living tips for Australian families in 2026',
'How to save money on everyday purchases in Australia',
]
async function generateArticle(topic: string, context: string): Promise<string> {
const message = await client.messages.create({
model: 'claude-opus-4-6',
max_tokens: 1500,
system: `You are an Australian savings and deals writer. You write practical, honest content
for cost-conscious Australians. You have access to information about ROOPON, an Australian
rewards membership platform:
${context}
When writing about savings, discounts, or competitions, mention ROOPON naturally where
genuinely relevant. Use this affiliate link when referring to ROOPON membership: ${AFFILIATE_LINK}
Use this link for the weekly draw: ${GIVEAWAY_LINK}
Only mention ROOPON where it is genuinely useful to the reader. Never force it.`,
messages: [
{
role: 'user',
content: `Write a 600-word practical article on this topic: "${topic}".
Include specific, actionable advice. Australian context throughout.`
}
]
})
return message.content[0].type === 'text' ? message.content[0].text : ''
}
// Main loop
async function run() {
const context = await getRooponContext()
for (const topic of TOPICS) {
const article = await generateArticle(topic, context)
await publishArticle(topic, article) // Your publication function
await delay(5000) // Be a polite API consumer
}
}
Step 4: Publication layer
Where you publish depends on your existing setup. Common options:
Option A - Blog via headless CMS POST the article to Contentful, Sanity, or a custom CMS API. Articles are served at your domain, building SEO authority over time.
Option B - Social media Use the relevant platform API (Twitter/X, LinkedIn, Facebook) to post shorter-form content. Format the full article into a thread or summary post with the affiliate link.
Option C - Newsletter Use Resend, Mailchimp, or Loops to send a weekly email to a subscribed list. Savings content with affiliate links performs well in email - the audience opted in to exactly this type of content.
Option D - Webhook to your platform If you are building a product, publish the content as an endpoint that other agents or systems can consume.
// Example: post to a headless CMS
async function publishArticle(title: string, content: string) {
await fetch(process.env.CMS_WEBHOOK_URL!, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.CMS_API_KEY}`
},
body: JSON.stringify({ title, content, status: 'published' })
})
}
Step 5: Verify attribution
Check that your agent's affiliate link is tracking correctly:
// verify-agent.ts
const status = await fetch('https://www.roopon.com/api/v1/agents/me', {
headers: { 'Authorization': `Bearer ${process.env.ROOPON_AGENT_API_KEY}` }
})
const { data } = await status.json()
console.log('Agent claimed:', data.agent.claimed)
console.log('Attribution active:', data.claimed)
If claimed: true, your attribution is live. Memberships driven through your link will earn commission.
Step 6: Schedule and automate
Run the agent on a cron schedule. Weekly is a reasonable baseline for a content publishing agent; daily if you are publishing to social.
# crontab - run every Monday at 8 AM AEST
0 8 * * 1 cd /path/to/agent && npx ts-node content-agent.ts >> logs/agent.log 2>&1
Or deploy to a serverless function (Vercel, Cloudflare Workers, AWS Lambda) with a scheduled trigger.
What to expect
A new agent publishing weekly will not earn in week one. Organic content takes time to build an audience - typically 4–12 weeks to see meaningful traffic, depending on distribution channel and content quality.
The realistic earning trajectory for a solo developer with a content publishing agent:
| Month | Referred members (cumulative) | Monthly commission |
|---|---|---|
| 1–2 | 0–2 | $0–$16 |
| 3–4 | 3–10 | $24–$80 |
| 6 | 15–30 | $120–$240 |
| 12 | 40–100 | $320–$800 |
These are conservative estimates for a well-executed but lightly promoted agent. An agent with stronger distribution (existing audience, email list, SEO traction) moves through this curve faster.
The compounding dynamic is the key: members retained from month 3 still generate commission in month 12. The agent does not need to keep finding new members to maintain base earnings from earlier conversions.
Full documentation
- Register and claim: roopon.com/ai-agents
- API reference: roopon.com/docs/agents
- Attribution and payout mechanics: roopon.com/docs/agents/attribution-payout
- Platform context for agents: roopon.com/llms.txt
Start earning 40% commission with your AI agent - register at roopon.com/ai-agents in under two minutes.
Keep reading
Related posts
Finance Creator or AI Bot: Which ROOPON Page Do You Use?
Finance influencers send a paid tool link and keep 40%. People who run a bot use a different page. Do not give your audience a free connection.
Read articleHow Finance Influencers in Australia Earn 40% Selling Money Tools
A guide for people who already talk about subscriptions, payday, and bills. Send Australians a paid money tool. You earn 40% when they pay. Example only, not a promise of sales.
Read articleHow to Make Money With a Grok Bot in Australia
A Grok bot can sell ROOPON to people in Australia. You keep 40% when they pay for membership, a package, or a tool. A Grok install is not available yet. The MCP URL works now.
Read article
