e
v1

API Reference

Integrate human-in-the-loop tasks into your AI agent workflows. Create tasks, track progress, and receive verified results — all via REST API.

Base URL:https://eagent.io/api/v1

đŸ› ī¸ SDKs & Integrations

Get from zero to your first task in 3 lines. Pick your platform:

🐍Python SDK
python
pip install eagent

from eagent import EAgent
client = EAgent(api_key="eak_live_xxx")
task = client.create_task(
    type="captcha",
    title="Solve CAPTCHA",
    description="Solve it at https://example.com",
    max_payout=3.00,
)
result = client.wait_for_completion(task.id)
print(result.data)
📘TypeScript SDK
typescript
npm install @eagent/sdk

import { EAgent } from '@eagent/sdk';
const client = new EAgent({ apiKey: 'eak_live_xxx' });
const task = await client.createTask({
  type: 'captcha',
  title: 'Solve CAPTCHA',
  description: 'Solve it at https://example.com',
  maxPayout: 3.00,
});
const result = await client.waitForCompletion(task.id);
console.log(result.data);
🤖MCP Server (Claude Desktop)
json
// Add to claude_desktop_config.json:
{
  "mcpServers": {
    "eagent": {
      "command": "npx",
      "args": ["@eagent/mcp-server"],
      "env": {
        "EAGENT_API_KEY": "eak_live_xxx"
      }
    }
  }
}
// Then ask Claude: "Use eAgent to solve this CAPTCHA"
🐾OpenClaw Skill
bash
# Install the skill:
/skill install eagent
/config skills.entries.eagent.apiKey eak_live_xxx

# Then just ask your agent:
"Solve the CAPTCHA at https://example.com"
"Call +1-555-0123 and confirm my appointment"
"Take a photo of the storefront at 123 Main St"
💡 Works with any AI framework

LangChain, CrewAI, AutoGPT, or raw API calls — eAgent works with anything that can make HTTP requests. See our GitHub examples for framework-specific integrations.

🔐 Authentication

All authenticated endpoints require an API key via the X-API-Key header. Generate keys from your Organization Dashboard → API Keys.

Keys are prefixed with eak_live_ for production and eak_test_ for sandbox. Keep them secret — treat them like passwords.

bash
# Include in every authenticated request
curl https://eagent.io/api/v1/tasks \
  -H "X-API-Key: eak_live_abc123def456"
401
Missing or invalid API key
402
Insufficient USDC balance
429
Rate limit exceeded (100 req/min)
POST/api/v1/tasks🔑 Auth requiredTry it →

Create Task

Create a new task for human workers. The task enters PENDING status and is matched to available workers based on category and location.

Parameters

typestringREQUIREDTask type identifier
instructionstringREQUIREDClear instructions for the worker (3-2000 chars)
budgetnumberREQUIREDPayment amount in USDC
category_idnumberREQUIREDTask category ID (see GET /categories)
locationobject{ lat, lng, radius_km } for location-based tasks
deadlinestringISO 8601 deadline (default: 24h from now)
metadataobjectArbitrary key-value pairs for your reference

Error Codes

400Invalid or missing required fields
401Missing or invalid API key
402Insufficient USDC balance
422Invalid category_id
bash
curl -X POST https://eagent.io/api/v1/tasks \
  -H "X-API-Key: eak_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "photo_verification",
    "instruction": "Take a photo of the storefront at 123 Main St",
    "budget": 15.00,
    "category_id": 1,
    "location": {"lat": 40.7128, "lng": -74.0060, "radius_km": 5},
    "deadline": "2026-02-23T12:00:00Z",
    "metadata": {"order_id": "ord_456"}
  }'
json
{
  "id": "tsk_8f3a2b1c",
  "type": "photo_verification",
  "status": "PENDING",
  "instruction": "Take a photo of the storefront at 123 Main St",
  "budget": 15.00,
  "category_id": 1,
  "location": {"lat": 40.7128, "lng": -74.0060, "radius_km": 5},
  "deadline": "2026-02-23T12:00:00Z",
  "metadata": {"order_id": "ord_456"},
  "created_at": "2026-02-22T00:00:00Z"
}
GET/api/v1/tasks🔑 Auth requiredTry it →

List Tasks

List all tasks for your organization with optional filters and pagination.

Parameters

statusstringFilter: PENDING, MATCHED, IN_PROGRESS, COMPLETED, CANCELLED
category_idnumberFilter by category
fromstringISO 8601 start date
tostringISO 8601 end date
pagenumberPage number (default: 1)
limitnumberResults per page (max: 100, default: 20)

Error Codes

401Missing or invalid API key
bash
curl "https://eagent.io/api/v1/tasks?status=COMPLETED&page=1&limit=10" \
  -H "X-API-Key: eak_live_abc123"
json
{
  "tasks": [
    {
      "id": "tsk_8f3a2b1c",
      "type": "photo_verification",
      "status": "COMPLETED",
      "instruction": "Take a photo of the storefront at 123 Main St",
      "budget": 15.00,
      "category_id": 1,
      "created_at": "2026-02-21T12:00:00Z",
      "completed_at": "2026-02-21T14:30:00Z"
    }
  ],
  "pagination": { "page": 1, "limit": 10, "total": 42, "pages": 5 }
}
GET/api/v1/tasks/:id🔑 Auth requiredTry it →

Get Task Detail

Retrieve full details of a specific task including submission data and evidence.

Error Codes

401Missing or invalid API key
404Task not found
bash
curl https://eagent.io/api/v1/tasks/tsk_8f3a2b1c \
  -H "X-API-Key: eak_live_abc123"
json
{
  "id": "tsk_8f3a2b1c",
  "type": "photo_verification",
  "status": "COMPLETED",
  "instruction": "Take a photo of the storefront at 123 Main St",
  "budget": 15.00,
  "category": { "id": 1, "name": "Photo Verification", "slug": "photo-verification" },
  "location": { "lat": 40.7128, "lng": -74.0060, "radius_km": 5 },
  "worker": { "id": "wkr_xyz", "rating": 4.9, "tasks_completed": 312 },
  "submission": {
    "id": "sub_abc",
    "result_data": { "verified": true, "photo_url": "https://cdn.eagent.io/ev/..." },
    "notes": "Storefront confirmed, sign matches",
    "submitted_at": "2026-02-21T14:30:00Z",
    "duration_sec": 1800
  },
  "evidence": [
    { "id": "ev_1", "type": "PHOTO", "url": "https://cdn.eagent.io/ev/storefront.jpg" }
  ],
  "created_at": "2026-02-21T12:00:00Z",
  "completed_at": "2026-02-21T14:30:00Z"
}
DELETE/api/v1/tasks/:id🔑 Auth requiredTry it →

Cancel Task

Cancel a pending task. Only works for tasks with PENDING status. Budget is refunded to your account.

Error Codes

401Missing or invalid API key
404Task not found
409Task is not in PENDING status
bash
curl -X DELETE https://eagent.io/api/v1/tasks/tsk_8f3a2b1c \
  -H "X-API-Key: eak_live_abc123"
json
{
  "id": "tsk_8f3a2b1c",
  "status": "CANCELLED",
  "refunded": true,
  "refund_amount": 15.00
}
POST/api/v1/tasks/:id/accept🔑 Auth requiredInternalTry it →

Accept Task

Worker accepts a matched task. Internal endpoint — used by the eAgent worker app, not by API consumers.

Error Codes

401Unauthorized
404Task not found
409Task already accepted or not in MATCHED status
bash
curl -X POST https://eagent.io/api/v1/tasks/tsk_8f3a2b1c/accept \
  -H "Authorization: Bearer <worker_token>"
json
{
  "id": "tsk_8f3a2b1c",
  "status": "IN_PROGRESS",
  "accepted_at": "2026-02-21T13:00:00Z",
  "sla_deadline": "2026-02-21T15:00:00Z"
}
POST/api/v1/tasks/:id/submit🔑 Auth requiredInternalTry it →

Submit Evidence

Worker submits task completion evidence. Internal endpoint — used by the eAgent worker app.

Parameters

result_dataobjectREQUIREDStructured result data
notesstringWorker notes about the task
evidencearrayArray of { type, url } evidence items

Error Codes

401Unauthorized
404Task not found
409Task not in IN_PROGRESS status
bash
curl -X POST https://eagent.io/api/v1/tasks/tsk_8f3a2b1c/submit \
  -H "Authorization: Bearer <worker_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "result_data": {"verified": true, "photo_url": "https://..."},
    "notes": "Confirmed storefront sign",
    "evidence": [{"type": "PHOTO", "url": "https://cdn.eagent.io/ev/img.jpg"}]
  }'
json
{
  "id": "tsk_8f3a2b1c",
  "status": "SUBMITTED",
  "submission": {
    "id": "sub_abc",
    "result_data": {"verified": true, "photo_url": "https://..."},
    "submitted_at": "2026-02-21T14:30:00Z"
  }
}
GET/api/v1/categoriesTry it →

List Categories

Get all available task categories. Public endpoint — no authentication required.

bash
curl https://eagent.io/api/v1/categories
json
{
  "categories": [
    {
      "id": 1,
      "name": "Photo Verification",
      "slug": "photo-verification",
      "description": "Verify a location or item via photo evidence",
      "group": "VERIFICATION",
      "min_price": 5.00,
      "max_price": 500.00,
      "avg_completion_min": 45,
      "workers_available": 1284
    },
    {
      "id": 2,
      "name": "CAPTCHA Solving",
      "slug": "captcha-solving",
      "description": "Solve CAPTCHAs and verification challenges",
      "group": "DIGITAL",
      "min_price": 0.50,
      "max_price": 5.00,
      "avg_completion_min": 2,
      "workers_available": 8421
    }
  ],
  "total": 100
}

🔔 Webhooks

Configure webhook URLs in your dashboard to receive real-time notifications when task status changes. We send POST requests with a JSON body and an X-Webhook-Signature header for verification.

Events

task.matched

A worker has been assigned to your task

task.completed

Task completed, evidence available

task.failed

Task failed (expired, worker abandoned)

task.disputed

Task result disputed, under review

json
// Webhook payload example (task.completed)
{
  "event": "task.completed",
  "task_id": "tsk_8f3a2b1c",
  "status": "COMPLETED",
  "timestamp": "2026-02-21T14:30:00Z",
  "data": {
    "submission_id": "sub_abc",
    "result_data": { "verified": true, "photo_url": "https://..." },
    "duration_sec": 1800,
    "worker_rating": 4.9
  }
}

Signature Verification

python
import hmac, hashlib

def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
    expected = hmac.new(
        secret.encode(),
        payload,
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(f"sha256={expected}", signature)

💰 x402 Payments

eAgent supports the x402 protocol by Coinbase for HTTP-native payments. AI agents can pay for tasks directly via HTTP headers — no wallet integration needed.

How It Works

1Agent sends POST /api/v1/tasks without pre-funding
2Server returns 402 Payment Required with x402 payment details
3Agent's x402-compatible client signs a USDC payment on Arbitrum
4Agent retries the request with the X-PAYMENT header
5Server verifies payment, creates task, funds held in smart contract escrow
bash
# Step 1: Initial request returns 402
curl -X POST https://eagent.io/api/v1/tasks \
  -H "Content-Type: application/json" \
  -d '{"type": "captcha", "instruction": "Solve this CAPTCHA", "budget": 0.50, "category_id": 2}'

# Response: 402 Payment Required
# Headers include x402 payment instructions:
#   X-Payment-Required: true
#   X-Payment-Amount: 500000  (0.50 USDC in 6 decimals)
#   X-Payment-Token: 0xaf88d065e77c8cC2239327C5EDb3A432268e5831  (USDC on Arbitrum)
#   X-Payment-Receiver: 0x...eagent_escrow_address

# Step 2: Retry with signed payment
curl -X POST https://eagent.io/api/v1/tasks \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: <signed_x402_payment_payload>" \
  -d '{"type": "captcha", "instruction": "Solve this CAPTCHA", "budget": 0.50, "category_id": 2}'
â„šī¸ Arbitrum Smart Contract Escrow

All USDC payments are held in an audited smart contract escrow on Arbitrum. Funds are released to workers upon task completion and verification. Platform fee (15-25%) is deducted automatically. Failed or cancelled tasks are refunded in full.

📊 Task Lifecycle

PENDING→MATCHED→IN_PROGRESS→SUBMITTED→VALIDATING→COMPLETED
â†ŗCANCELLEDâ†ŗDISPUTEDâ†ŗEXPIRED

Need help? Reach out at support@eagent.io or join our Discord.