# Loopuman — Node.js SDK

**The Human API for AI.** Post tasks to verified humans worldwide. Get results in minutes. Workers get paid in 8 seconds via blockchain.
```bash
npm install loopuman
```

## Quick Start
```javascript
const Loopuman = require('loopuman');
const client = new Loopuman({ apiKey: 'lp_...' });

const result = await client.ask('Is this content appropriate for children?');
console.log(result.response);
```

## Bulk Data Labeling
```javascript
const batch = await client.bulkCreate([
  { title: 'Label image 1', description: 'Cat or dog?', budget: 25 },
  { title: 'Label image 2', description: 'Cat or dog?', budget: 25 },
], { webhookUrl: 'https://myserver.com/webhook' });

const results = await client.waitForBatch(batch.batch_id, {
  onProgress: (s) => console.log(`${s.completed}/${s.total} done`)
});
```

## Methods

| Method | Description |
|--------|-------------|
| `ask(question, opts?)` | Ask human, wait for answer |
| `createTask(task)` | Create task, return immediately |
| `bulkCreate(tasks, opts?)` | Up to 10,000 tasks per call |
| `getBatch(id)` | Batch progress |
| `getResults(id)` | Download results |
| `waitForBatch(id, opts?)` | Poll until complete |
| `health()` | API status |

## Zero Dependencies

Pure Node.js `http`/`https`. Works with Node 14+.

## Also Available

- **Python SDK**: `pip install loopuman`
- **MCP Server**: `npm install -g loopuman-mcp`
- **REST API**: api.loopuman.com

## License

MIT — [loopuman.com](https://loopuman.com)
