ChargedAPI Documentation

Getting Started

ChargedAPI is a powerful document and image conversion API supporting 25+ formats, PDF tools, AI-powered features, and document generation.

Base URL

https://api.chargedapi.com

Authentication

Include your API key in the X-API-Key header:

curl -H "X-API-Key: your_api_key" https://api.chargedapi.com/usage

Credit System

1 credit
Standard conversions
1 credit
PDF tools, image tools
1 credit
AI features (redact, extract, remove-bg)

Check Usage

curl -H "X-API-Key: your_api_key" https://api.chargedapi.com/usage

# Response
{
  "plan": "pro",
  "credits_used": 150,
  "credits_limit": 2000,
  "credits_remaining": 1850
}

Quick Start Examples

# Convert DOCX to PDF
curl -X POST "https://api.chargedapi.com/convert?format=pdf" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.docx"

# Compress a PDF
curl -X POST "https://api.chargedapi.com/pdf/compress" \
  -H "X-API-Key: your_api_key" \
  -F "file=@large.pdf" --output compressed.pdf

# Remove image background
curl -X POST "https://api.chargedapi.com/image/remove-bg" \
  -H "X-API-Key: your_api_key" \
  -F "file=@photo.jpg" --output nobg.png

Convert API

Convert documents, spreadsheets, presentations, and images between 25+ formats.

POST /convert?format={output_format} 1 credit

Convert a file to the specified output format

Supported Formats (25+)

Documents

pdf, docx, doc, rtf, odt, txt

Spreadsheets

xlsx, xls, ods, csv

Presentations

pptx, ppt, odp

Web & Data

html, xml, json, md

Images

png, jpg, jpeg, webp, gif, bmp, tiff

eBooks

epub

Examples

# DOCX to PDF
curl -X POST "https://api.chargedapi.com/convert?format=pdf" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.docx"

# Excel to CSV
curl -X POST "https://api.chargedapi.com/convert?format=csv" \
  -H "X-API-Key: your_api_key" \
  -F "file=@spreadsheet.xlsx"

# PowerPoint to PDF
curl -X POST "https://api.chargedapi.com/convert?format=pdf" \
  -H "X-API-Key: your_api_key" \
  -F "file=@presentation.pptx"

# HTML to PDF
curl -X POST "https://api.chargedapi.com/convert?format=pdf" \
  -H "X-API-Key: your_api_key" \
  -F "file=@page.html"

# Image to WebP
curl -X POST "https://api.chargedapi.com/convert?format=webp" \
  -H "X-API-Key: your_api_key" \
  -F "file=@photo.jpg"

Response

{
  "job_id": "abc123-def456-...",
  "status": "processing"
}

# Poll /status/{job_id} to get download URL when complete

PDF Tools

Manipulate PDF files: merge, split, compress, watermark, protect, and more.

POST /pdf/merge 1 credit

Merge multiple PDFs into one document

curl -X POST "https://api.chargedapi.com/pdf/merge" \
  -H "X-API-Key: your_api_key" \
  -F "files=@doc1.pdf" -F "files=@doc2.pdf" -F "files=@doc3.pdf" \
  --output merged.pdf
POST /pdf/split 1 credit

Split PDF into separate pages (returns ZIP)

curl -X POST "https://api.chargedapi.com/pdf/split" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf" --output pages.zip
POST /pdf/compress 1 credit

Compress PDF to reduce file size. Quality: low, medium (default), high, maximum

curl -X POST "https://api.chargedapi.com/pdf/compress?quality=medium" \
  -H "X-API-Key: your_api_key" \
  -F "file=@large.pdf" --output compressed.pdf
POST /pdf/watermark 1 credit

Add text watermark to PDF pages

textWatermark text (required)
positiondiagonal (default), center, top, bottom
opacity0.1-1.0 (default: 0.3)
colorgray (default), red, blue, green, black
font_sizeFont size in points (default: 48)
curl -X POST "https://api.chargedapi.com/pdf/watermark?text=CONFIDENTIAL&position=diagonal&opacity=0.3&color=red" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf" --output watermarked.pdf
POST /pdf/protect 1 credit

Password-protect a PDF

curl -X POST "https://api.chargedapi.com/pdf/protect?password=secret123" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf" --output protected.pdf
POST /pdf/unlock 1 credit

Remove password from a protected PDF

curl -X POST "https://api.chargedapi.com/pdf/unlock?password=secret123" \
  -H "X-API-Key: your_api_key" \
  -F "file=@protected.pdf" --output unlocked.pdf
POST /pdf/rotate 1 credit

Rotate PDF pages. Angle: 90, 180, 270

curl -X POST "https://api.chargedapi.com/pdf/rotate?angle=90" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf" --output rotated.pdf
POST /pdf/ocr 1 credit (AI)

OCR scanned PDFs to make text searchable/selectable

curl -X POST "https://api.chargedapi.com/pdf/ocr" \
  -H "X-API-Key: your_api_key" \
  -F "file=@scanned.pdf" --output searchable.pdf

Image Tools

Process images: resize, convert, compress, crop, rotate, and apply effects.

POST /image/resize

Resize image by dimensions or percentage

Params: width, height, percentage
curl -X POST "https://api.chargedapi.com/image/resize?width=800&height=600" \
  -H "X-API-Key: your_api_key" -F "file=@image.jpg"
POST /image/convert

Convert between image formats

Params: format (png/jpg/webp/gif/bmp), quality
curl -X POST "https://api.chargedapi.com/image/convert?format=webp&quality=85" \
  -H "X-API-Key: your_api_key" -F "file=@photo.jpg"
POST /image/compress

Compress image to reduce file size

Params: quality (1-100, default: 80)
curl -X POST "https://api.chargedapi.com/image/compress?quality=60" \
  -H "X-API-Key: your_api_key" -F "file=@large.jpg"
POST /image/crop

Crop image to specified dimensions

Params: width, height, x (default: 0), y (default: 0)
curl -X POST "https://api.chargedapi.com/image/crop?width=400&height=400&x=100&y=50" \
  -H "X-API-Key: your_api_key" -F "file=@image.jpg"
POST /image/rotate

Rotate image by angle

Params: angle (90, 180, 270, -90)
curl -X POST "https://api.chargedapi.com/image/rotate?angle=90" \
  -H "X-API-Key: your_api_key" -F "file=@image.jpg"
POST /image/flip

Flip image horizontally or vertically

Params: direction (horizontal/vertical)
curl -X POST "https://api.chargedapi.com/image/flip?direction=horizontal" \
  -H "X-API-Key: your_api_key" -F "file=@image.jpg"
POST /image/grayscale

Convert image to black and white

curl -X POST "https://api.chargedapi.com/image/grayscale" \
  -H "X-API-Key: your_api_key" -F "file=@image.jpg"
POST /image/blur

Apply gaussian blur effect

Params: radius (1-20, default: 5)
curl -X POST "https://api.chargedapi.com/image/blur?radius=10" \
  -H "X-API-Key: your_api_key" -F "file=@image.jpg"
POST /image/brightness

Adjust brightness and contrast

Params: brightness (0.1-2.0), contrast (0.1-2.0)
curl -X POST "https://api.chargedapi.com/image/brightness?brightness=1.3&contrast=1.2" \
  -H "X-API-Key: your_api_key" -F "file=@image.jpg"
POST /image/invert

Invert colors (negative effect)

curl -X POST "https://api.chargedapi.com/image/invert" \
  -H "X-API-Key: your_api_key" -F "file=@image.jpg"
POST /image/sepia

Apply vintage sepia tone effect

curl -X POST "https://api.chargedapi.com/image/sepia" \
  -H "X-API-Key: your_api_key" -F "file=@image.jpg"
POST /image/remove-bg 1 credit

AI-powered background removal

Params: format (png/jpg, default: png)
curl -X POST "https://api.chargedapi.com/image/remove-bg?format=png" \
  -H "X-API-Key: your_api_key" -F "file=@photo.jpg"

Document Generation

Generate documents from templates and manage PDF forms.

POST /generate/docx 1 credit

Generate DOCX/PDF from template with {{placeholders}}

templateDOCX file with {{placeholder}} syntax
dataJSON object with values
outputdocx (default) or pdf
# Template contains: Hello {{name}}, your invoice #{{invoice_number}}...

curl -X POST "https://api.chargedapi.com/generate/docx?output=pdf" \
  -H "X-API-Key: your_api_key" \
  -F "template=@template.docx" \
  -F 'data={"name": "John Smith", "invoice_number": "INV-001", "date": "2024-01-15", "total": "$500.00"}' \
  --output generated.pdf
POST /generate/html-pdf 1 credit

Convert HTML template (with Jinja2 syntax) to PDF

templateHTML file with Jinja2 {{variables}}
dataJSON object with values
page_sizeA4 (default), Letter, Legal
curl -X POST "https://api.chargedapi.com/generate/html-pdf?page_size=A4" \
  -H "X-API-Key: your_api_key" \
  -F "template=@report.html" \
  -F 'data={"title": "Sales Report", "items": [{"name": "Widget", "qty": 10}]}' \
  --output report.pdf
POST /generate/export-form 1 credit

Extract form field data from fillable PDFs as JSON

curl -X POST "https://api.chargedapi.com/generate/export-form" \
  -H "X-API-Key: your_api_key" \
  -F "file=@filled_form.pdf"

# Response
{
  "fields": {
    "first_name": "John",
    "last_name": "Smith",
    "email": "john@example.com",
    "date": "2024-01-15"
  }
}
POST /generate/import-form 1 credit

Fill PDF form fields with JSON data

curl -X POST "https://api.chargedapi.com/generate/import-form" \
  -H "X-API-Key: your_api_key" \
  -F "file=@blank_form.pdf" \
  -F 'data={"first_name": "John", "last_name": "Smith", "email": "john@example.com"}' \
  --output filled_form.pdf

Data Extraction

Extract structured data from documents. Returns JSON with parsed fields.

POST /extract/invoice 1 credit

Extract invoice data: vendor, invoice number, date, line items, totals, tax

curl -X POST "https://api.chargedapi.com/extract/invoice" \
  -H "X-API-Key: your_api_key" \
  -F "file=@invoice.pdf"

# Response
{
  "vendor": "Acme Corp",
  "invoice_number": "INV-2024-001",
  "date": "2024-01-15",
  "items": [
    {"description": "Widget A", "quantity": 10, "unit_price": 25.00, "total": 250.00}
  ],
  "subtotal": 250.00,
  "tax": 20.00,
  "total": 270.00
}
POST /extract/receipt 1 credit

Extract receipt data: merchant, date, items, total, payment method

curl -X POST "https://api.chargedapi.com/extract/receipt" \
  -H "X-API-Key: your_api_key" \
  -F "file=@receipt.jpg"
POST /extract/contract 1 credit

Extract contract data: parties, effective date, terms, obligations

curl -X POST "https://api.chargedapi.com/extract/contract" \
  -H "X-API-Key: your_api_key" \
  -F "file=@contract.pdf"
POST /extract/resume 1 credit

Extract resume data: name, contact info, skills, experience, education

curl -X POST "https://api.chargedapi.com/extract/resume" \
  -H "X-API-Key: your_api_key" \
  -F "file=@resume.pdf"

# Response
{
  "name": "John Smith",
  "email": "john@example.com",
  "phone": "+1-555-123-4567",
  "skills": ["Python", "JavaScript", "SQL"],
  "experience": [...],
  "education": [...]
}
POST /extract/bank_statement 1 credit

Extract bank statement data: account info, transactions, balances

curl -X POST "https://api.chargedapi.com/extract/bank_statement" \
  -H "X-API-Key: your_api_key" \
  -F "file=@statement.pdf"
POST /extract/purchase_order 1 credit

Extract purchase order data: PO number, vendor, line items, totals

curl -X POST "https://api.chargedapi.com/extract/purchase_order" \
  -H "X-API-Key: your_api_key" \
  -F "file=@po.pdf"
POST /extract/pay_stub 1 credit

Extract pay stub data: employee info, earnings, deductions, taxes

curl -X POST "https://api.chargedapi.com/extract/pay_stub" \
  -H "X-API-Key: your_api_key" \
  -F "file=@paystub.pdf"
POST /extract/table 1 credit

Extract tables from documents as JSON arrays

curl -X POST "https://api.chargedapi.com/extract/table" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf"

AI-Powered Tools

Advanced features using AI. Each costs 1 credit.

POST /ai/redact 1 credit

Automatically detect and redact sensitive information (PII)

Detects: Names, emails, phone numbers, SSN, addresses, credit cards, dates
curl -X POST "https://api.chargedapi.com/ai/redact" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf" --output redacted.pdf

# Optional: specify what to redact
curl -X POST "https://api.chargedapi.com/ai/redact?types=email,phone,ssn" \
  -H "X-API-Key: your_api_key" \
  -F "file=@document.pdf"
POST /image/remove-bg 1 credit

AI-powered background removal from images

curl -X POST "https://api.chargedapi.com/image/remove-bg?format=png" \
  -H "X-API-Key: your_api_key" \
  -F "file=@photo.jpg" --output nobg.png
POST /pdf/ocr 1 credit

OCR scanned PDFs to make text searchable and selectable

curl -X POST "https://api.chargedapi.com/pdf/ocr" \
  -H "X-API-Key: your_api_key" \
  -F "file=@scanned.pdf" --output searchable.pdf
POST /ai/screenshot 1 credit

Capture any webpage as a high-quality screenshot image

Formats: PNG, JPEG, WebP | Options: full page, custom viewport size
# Basic screenshot
curl -X POST "https://api.chargedapi.com/ai/screenshot" \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}' --output screenshot.png

# Full page JPEG with custom width
curl -X POST "https://api.chargedapi.com/ai/screenshot" \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "format": "jpeg", "width": 1920, "full_page": true, "quality": 90}' \
  --output screenshot.jpg
POST /ai/screenshots 1 credit/URL

Capture multiple webpages as screenshots, returned as a ZIP file

Max 10 URLs | Formats: PNG, JPEG, WebP | Returns: ZIP archive
# Batch screenshots (returns ZIP)
curl -X POST "https://api.chargedapi.com/ai/screenshots" \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://example.com", "https://github.com", "https://google.com"]}' \
  --output screenshots.zip

# With options
curl -X POST "https://api.chargedapi.com/ai/screenshots" \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://example.com", "https://github.com"], "format": "jpeg", "width": 1920, "full_page": true}' \
  --output screenshots.zip

Reference

Job Status

GET /status/{job_id}

Check job status and get download URL when complete

curl -H "X-API-Key: your_api_key" \
  "https://api.chargedapi.com/status/abc123-def456"

# Response (processing)
{"job_id": "abc123-def456", "status": "processing"}

# Response (completed)
{"job_id": "abc123-def456", "status": "completed", "download_url": "https://..."}
pending processing completed failed

Download Result

GET /download/{job_id}

Download the converted/processed file

curl -H "X-API-Key: your_api_key" \
  "https://api.chargedapi.com/download/abc123-def456" \
  --output result.pdf

Webhooks

Get notified instantly when your job completes - no polling needed!

How to Use Webhooks

Add the X-Webhook-URL header to any request:

curl -X POST "https://api.chargedapi.com/convert?format=pdf" \
  -H "X-API-Key: your_api_key" \
  -H "X-Webhook-URL: https://your-server.com/webhook" \
  -F "file=@document.docx"

What You'll Receive

When your job completes, we POST to your URL:

{
  "event": "job.completed",
  "job_id": "abc123-def456",
  "status": "completed",
  "download_url": "https://api.chargedapi.com/download/abc123-def456",
  "timestamp": "2026-01-18T12:00:00Z"
}

// If job fails:
{
  "event": "job.failed",
  "job_id": "abc123-def456",
  "status": "failed",
  "error_message": "Invalid file format",
  "timestamp": "2026-01-18T12:00:00Z"
}

Verify Webhook Signatures

Every webhook includes an X-Webhook-Signature header. Verify it to ensure the request came from ChargedAPI:

1. Get your webhook secret:

curl -H "X-API-Key: your_api_key" \
  "https://api.chargedapi.com/webhook-secret"

# Response: {"webhook_secret": "95f15d88da59f54d..."}

2. Verify in your code (Python example):

import hmac
import hashlib

def verify_webhook(request):
    signature = request.headers.get('X-Webhook-Signature', '')
    body = request.get_data()  # raw body bytes
    
    expected = 'sha256=' + hmac.new(
        WEBHOOK_SECRET.encode(),
        body,
        hashlib.sha256
    ).hexdigest()
    
    return hmac.compare_digest(signature, expected)

Node.js example:

const crypto = require('crypto');

function verifyWebhook(body, signature) {
    const expected = 'sha256=' + crypto
        .createHmac('sha256', WEBHOOK_SECRET)
        .update(body)
        .digest('hex');
    return signature === expected;
}

Regenerate Secret

If your secret is compromised, regenerate it:

curl -X POST -H "X-API-Key: your_api_key" \
  "https://api.chargedapi.com/webhook-secret/regenerate"

Note: Update your server with the new secret immediately.

Error Codes

CodeDescription
400Bad request / Invalid parameters / Unsupported format
401Invalid or missing API key
404Job not found
413File too large (max 50MB)
429Rate limit exceeded / Quota exceeded
500Server error

Rate Limits

PlanCredits/MonthRate LimitMax File
Free5010 req/min10 MB
Basic ($19)50030 req/min25 MB
Pro ($49)2,50060 req/min50 MB
Enterprise ($149)10,000120 req/min100 MB

SDKs & Examples

Python

import requests

response = requests.post(
    "https://api.chargedapi.com/convert?format=pdf",
    headers={"X-API-Key": "your_api_key"},
    files={"file": open("doc.docx", "rb")}
)
job_id = response.json()["job_id"]

JavaScript (Node.js)

const form = new FormData();
form.append('file', fs.createReadStream('doc.docx'));

const res = await fetch(
  'https://api.chargedapi.com/convert?format=pdf',
  {
    method: 'POST',
    headers: {'X-API-Key': 'your_api_key'},
    body: form
  }
);