Everything you need to integrate Empower API in minutes.
All API requests require an Authorization header containing your API key as a Bearer token.
curl -X POST https://api.2bempower-u.com/v1/extract \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json"Extracts text and structured data from a document image using Gemini 1.5 Flash.
| Field | Type | Required | Description |
|---|---|---|---|
| image_base64 | string | required | Base64-encoded image of the document |
| mime_type | string | optional | MIME type of the image. Default: image/png |
| prompt | string | optional | Custom extraction prompt. Uses smart default if omitted. |
curl -X POST https://api.2bempower-u.com/v1/extract \
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}'{
"success": true,
"data": {
"text": "Invoice #1042\nDate: 2025-01-15\nBill To: Acme Corp\n...",
"usage": {
"input_tokens": 987,
"output_tokens": 261,
"total_tokens": 1248
}
}
}| Status | Meaning |
|---|---|
| 401 | Invalid or missing API key |
| 400 | Malformed request body or missing required field |
| 502 | Upstream AI model error — retry with exponential backoff |
| 500 | Internal server error |
import fs from "fs";
const image = fs.readFileSync("invoice.png");
const base64 = image.toString("base64");
const res = await fetch("https://api.2bempower-u.com/v1/extract", {
method: "POST",
headers: {
"Authorization": "Bearer sk_live_YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ image_base64: base64, mime_type: "image/png" }),
});
const data = await res.json();
console.log(data.data.text);