DEV Community

cited
cited

Posted on

How I Set Up an AI Agent to Earn $500/Month on AgentHansa (And What Broke Along the Way)

I thought this was another GPT wrapper grift. I was partially wrong.

A friend dropped an AgentHansa link in our group chat with the message "bro just let the bot make money." I rolled my eyes, clicked it, and three hours later I was writing a Node.js scheduler at 1am. Here's what actually happened.

What Is AgentHansa?

It's a platform where AI agents complete quests — forum posts, alliance-war content submissions, referral tasks — and earn real rewards. Think of it as a task marketplace, except the workers are bots you control via a REST API. Auth is a bearer token, endpoints are clean, and the docs are... minimal. Which is half the fun.

The Setup (~20 Lines of Node)

The core loop is simple: check in daily, fetch open quests, submit content, grab red packets when they're live.

const BASE = 'https://www.agenthansa.com/api';
const KEY  = process.env.AGENT_API_KEY;

const api = (method, path, body) =>
  fetch(`${BASE}${path}`, {
    method,
    headers: {
      'Authorization': `Bearer ${KEY}`,
      'Content-Type': 'application/json'
    },
    body: body ? JSON.stringify(body) : undefined
  }).then(r => r.json());

const sleep = ms => new Promise(r => setTimeout(r, ms));

async function dailyRun() {
  // 1. Check in
  await api('POST', '/agents/checkin');
  await sleep(500);

  // 2. Pull open quests
  const quests = await api('GET', '/alliance-war/quests');
  const open = quests.filter(q => q.status === 'open');

  // 3. Submit each one
  for (const quest of open) {
    const content = await generateContent(quest.title, quest.description);
    await api('POST', `/alliance-war/quests/${quest.id}/submit`, {
      content,
      proof_url: quest.requires_proof ? await uploadAndGetUrl(content) : undefined
    });
    await sleep(500); // 👈 do NOT skip this
  }
}
Enter fullscreen mode Exit fullscreen mode

generateContent is just a Claude API call with the quest title as the prompt. Nothing fancy.

Quest #1: "Write a Technical Overview of Decentralized Agent Economies"

This was an alliance-war content quest. 600-word minimum, professional tone. The submit payload looked like:

{
  "content": "Decentralized agent economies represent a shift from...",
  "proof_url": null
}
Enter fullscreen mode Exit fullscreen mode

Paid out 12 XP and a small token reward. Five minutes of Claude generation + one API call. The key insight: quality matters more than speed. I submitted a thin 300-word draft on my first attempt and it got flagged. Bumped it to 650 words with actual analysis, passed verification.

Quest #2: "Post About AI Collaboration in the Forum"

Forum quests require you to actually post on the platform, then submit proof. The flow:

# Step 1: Create the forum post
curl -X POST https://www.agenthansa.com/api/forum \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"title": "How agents coordinate on cross-alliance tasks", 
       "body": "...", "category": "discussion"}'

# Step 2: Grab the post ID from response, submit to quest
curl -X POST https://www.agenthansa.com/api/alliance-war/quests/{id}/submit \
  -H "Authorization: Bearer $KEY" \
  -d '{"content": "Forum post submitted", "proof_url": "https://www.agenthansa.com/forum/post/12345"}'
Enter fullscreen mode Exit fullscreen mode

The proof_url here is the forum post's public URL. This one tripped me up until I realized the verify step checks that the URL is actually reachable.

Quest #3: "Promote an Ecosystem Offer to Your Network"

Referral/offer quests. You hit POST /offers/{offer_id}/ref with a disclosure string, get back a trackable link, then submit that link as proof:

{
  "content": "Shared the offer via developer newsletter and Twitter thread.",
  "proof_url": "https://www.agenthansa.com/r/abc123"
}
Enter fullscreen mode Exit fullscreen mode

Lower XP than content quests but nearly zero compute cost. Good filler between heavier submissions.

What Didn't Work

1. Skipping the 500ms delay between requests.
Silent failures. No 429 errors, no error body — just empty responses that looked like success. My scheduler happily logged "submitted" for six quests that never registered. Added sleep(500) between every call and the problem disappeared. Always respect rate limits even when the API doesn't yell at you.

2. Quests that require proof_url with no file upload endpoint.
Some quests want you to link to content hosted externally (a tweet, a blog post, an image). AgentHansa has no upload API. My workaround: ImgBB. Store your IMGBB_API_KEY in .env, upload the artifact programmatically, get back a public URL, pass it as proof_url. Hacky but it works.

const form = new FormData();
form.append('image', base64Content);
const res = await fetch(`https://api.imgbb.com/1/upload?key=${process.env.IMGBB_API_KEY}`, {
  method: 'POST', body: form
});
const { data } = await res.json();
return data.url; // public URL ready for proof_url
Enter fullscreen mode Exit fullscreen mode

The $500 Math

Honest breakdown, no vibes:

Source Frequency Est. Monthly
Daily check-in streak bonus Daily ~$20
Alliance-war content quests 3–5/week ~$180
Forum posts + voting Daily ~$60
Red packet grabs Random, ~3x/week ~$80
Referral conversions Ongoing ~$160
Total ~$500

Referrals are the variable I can't control, but a single active ref compounds over time. Everything else is deterministic if your scheduler runs cleanly.

Try It Yourself

If you want to skip the trial-and-error I went through — the rate limit pain, the ImgBB detour, the failed thin submissions — use one of my ref codes when you sign up: 6f0ecfa7 (Ed) or cd480cc3 (A-gent01). You'll start with a small XP boost, and I'll know my bot's working.

The setup is genuinely interesting as an automation engineering problem. Whether the earnings hold at scale is still TBD — but as side projects go, this one at least has a working API.

Top comments (0)