ZeroPhantom API

File Converter & OCR: 1 credit/call. Temp Mail API: Free. All on one credit wallet. Credits never expire.

Quick Start

Three steps to your first API call:

1
Create Portal Account
Sign up free at /signup
2
Get API Key
3
Buy Credits
From $5 at /buy-credits
curl
Python
JavaScript
PHP
# Convert a PDF to plain text — 1 credit
curl -X POST https://zphantom.com/api/convert \
  -H "X-API-Key: zpk_your_key_here" \
  -F "file=@document.pdf" \
  -F "to=txt" \
  -o result.txt
import requests

r = requests.post(
    "https://zphantom.com/api/convert",
    headers={"X-API-Key": "zpk_your_key_here"},
    files={"file": open("document.pdf", "rb")},
    data={"to": "txt"},
)
with open("result.txt", "wb") as f:
    f.write(r.content)
print("Credits left:", r.headers.get("X-Credits-Remaining"))
const form = new FormData();
form.append("file", fileInput.files[0]);
form.append("to", "txt");

const res = await fetch("https://zphantom.com/api/convert", {
  method: "POST",
  headers: { "X-API-Key": "zpk_your_key_here" },
  body: form,
});
const blob = await res.blob();
const url = URL.createObjectURL(blob);
// Trigger download
const a = document.createElement("a");
a.href = url; a.download = "result.txt"; a.click();
$ch = curl_init("https://zphantom.com/api/convert");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ["X-API-Key: zpk_your_key_here"],
  CURLOPT_POSTFIELDS => [
    "file" => new CURLFile("document.pdf"),
    "to"   => "txt",
  ],
  CURLOPT_RETURNTRANSFER => true,
]);
file_put_contents("result.txt", curl_exec($ch));
curl_close($ch);

Authentication

Pass your API key in the X-API-Key header on every request. Keys start with zpk_.

Get your key at Portal → API Keys → Create Key. One account can have multiple keys. Revoke anytime.
X-API-Key: zpk_xxxxxxxxxxxxxxxxxxxx

Pricing — Why We're Cheapest

File Converter & OCR: 1 credit/call ($0.0020). TempMail API: Free. Credits never expire. Compare:

ServicePrice per conversion$5 buys youNotes
🟢 ZeroPhantom Converter$0.0020 / call2,500 calls200+ formats. Credits never expire.
Zamzar$0.05 / call100 calls25× more expensive$25/month plan
CloudConvert$0.016–$0.08 / call62–312 calls8–40× more expensivePer-minute packages
ConvertAPI$0.003–$0.01 / call500–1666 calls2–5× more expensiveMonthly subscription
🟢 ZeroPhantom TempMailFREEUnlimitedNo credits. API key required.
Mailslurp$0.01+ / inbox500 inboxesPaidPer-inbox pricing
mail.tmFree (public)8 req/s sharedNo commercial useNo SLA, TOS restricts resale
Starter
$5
2,500 credits
$0.0020/call
Standard
$15
8,750 credits
${{ '%.4f'|format(15.0/8750) }}/call
Pro
$30
20,000 credits
${{ '%.4f'|format(30.0/20000) }}/call
Business
$60
45,000 credits
${{ '%.4f'|format(60.0/45000) }}/call
Buy Credits Now

Credits API

GET /api/credits/balance Get balance — free
curl https://zphantom.com/api/credits/balance \
  -H "X-API-Key: zpk_your_key"
{ "balance": 2487, "email": "you@example.com" }

Error Codes

HTTPcodeMeaning
400INVALID_FORMATUnsupported conversion pair or bad parameters
401INVALID_API_KEYKey missing, revoked, or malformed
402INSUFFICIENT_CREDITSBalance too low — top up here →
413FILE_TOO_LARGEFile exceeds 50 MB limit
429RATE_LIMITEDToo many requests — see rate limits below
500CONVERSION_FAILEDServer-side error — no credit charged
Credits are never deducted on 4xx or 5xx errors. You only pay for successful responses (2xx).

Rate Limits

60
requests / minute
500
requests / hour
50 MB
max file size
Limits are per API key. Response headers include X-RateLimit-Remaining and Retry-After (on 429).

File Converter API

Convert between 75+ formats — images, PDFs, documents, spreadsheets, data, and code. 1 credit per conversion. Always free at /converter in the browser.

Supported formats: JPG, PNG, WEBP, GIF, BMP, TIFF, ICO, SVG, PDF, DOCX, TXT, MD, HTML, XLSX, CSV, JSON, XML, YAML, TOML, INI, TSV, RTF, ODT, RST, PPTX, EPUB, SQL and more.
GET /api/converter/formats List all supported formats — free
curl https://zphantom.com/api/converter/formats \
  -H "X-API-Key: zpk_your_key"
{ "map": { "pdf": ["txt","png","jpg","docx","html","xlsx","csv","md"], "docx": ["pdf","txt","html","md","rst"], "jpg": ["png","webp","pdf","txt","bmp","gif","tiff","ico"], // ...75+ formats total }, "total_pairs": 240 }
POST /api/convert Convert file — 1 credit

Upload as multipart/form-data. Response is the converted file (binary).

ParameterTypeRequiredDescription
fileFilerequiredThe file to convert. Max 50 MB.
conversion_typestringrequiredTarget format or full key: pdf, png, txt, docx — or full key like docx_to_pdf
qualityintegeroptionalImage quality 1–100 (default: 85)
dpiintegeroptionalDPI for PDF→image rendering (default: 150)
formatstringoptionalPass url to get a JSON response with a download_url instead of raw bytes. Ideal for scripts & automation. Default: raw file.
curl
Python
JavaScript
PHP
# DOCX → PDF (raw bytes — saves directly)
curl -X POST https://zphantom.com/api/convert \
  -H "X-API-Key: zpk_your_key" \
  -F "file=@report.docx" \
  -F "conversion_type=pdf" \
  -o output.pdf

# PNG → WebP at quality 90
curl -X POST https://zphantom.com/api/convert \
  -H "X-API-Key: zpk_your_key" \
  -F "file=@photo.png" \
  -F "conversion_type=webp" \
  -F "quality=90" \
  -o photo.webp

# Get JSON with download_url instead of raw bytes (?format=url)
curl -X POST "https://zphantom.com/api/convert?format=url" \
  -H "X-API-Key: zpk_your_key" \
  -F "file=@report.docx" \
  -F "conversion_type=pdf"
# → {"success":true,"download_url":"/api/download/report_123_converted.pdf"}
import requests, pathlib

def convert(path: str, to: str, **kwargs) -> bytes:
    with open(path, "rb") as f:
        r = requests.post(
            "https://zphantom.com/api/convert",
            headers={"X-API-Key": "zpk_your_key"},
            files={"file": (pathlib.Path(path).name, f)},
            data={"conversion_type": to, **kwargs},
        )
    r.raise_for_status()
    print("Credits left:", r.headers.get("X-Credits-Remaining"))
    return r.content

# Examples
pdf_bytes  = convert("report.docx", "pdf")
webp_bytes = convert("photo.png",   "webp", quality=90)
txt_bytes  = convert("scan.pdf",    "txt")   # OCR
async function convertFile(file, toFormat) {
  const form = new FormData();
  form.append("file", file);
  form.append("conversion_type", toFormat);

  const res = await fetch("https://zphantom.com/api/convert", {
    method: "POST",
    headers: { "X-API-Key": "zpk_your_key" },
    body: form,
  });

  if (!res.ok) {
    const err = await res.json();
    throw new Error(err.message || "Conversion failed");
  }

  console.log("Credits left:", res.headers.get("X-Credits-Remaining"));
  return res.blob(); // save or display as needed
}
<?php
function convert(string $path, string $to): string {
    $ch = curl_init("https://zphantom.com/api/convert");
    curl_setopt_array($ch, [
        CURLOPT_POST           => true,
        CURLOPT_HTTPHEADER     => ["X-API-Key: zpk_your_key"],
        CURLOPT_POSTFIELDS     => [
            "file" => new CURLFile($path),
            "conversion_type" => $to,
        ],
        CURLOPT_RETURNTRANSFER => true,
    ]);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
}

file_put_contents("output.pdf", convert("report.docx", "pdf"));

Response headers: X-Credits-Used: 1 · X-Credits-Remaining: N · Content-Type: application/octet-stream

Quick Inbox Recommended

Create a disposable inbox in a single request — no address or password needed. Use the returned token as Authorization: Bearer TOKEN on all subsequent calls.

One call replaces the old 2-step create + authenticate flow. All temp mail endpoints are free — no credits deducted.
POST /api/tempmail/inbox One-shot inbox — free
ParameterTypeRequiredDescription
domainstringoptionalPreferred domain (defaults to first available)
prefixstringoptionalUsername prefix, e.g. testtestabc123@...
curl
Python
JavaScript
curl -X POST https://zphantom.com/api/tempmail/inbox \
  -H "X-API-Key: zpk_your_key"
import requests

r = requests.post(
    "https://zphantom.com/api/tempmail/inbox",
    headers={"X-API-Key": "zpk_your_key"},
)
data = r.json()
address = data["address"]  # abc123@mail.zphantom.com
token   = data["token"]    # use as Bearer token going forward
const r = await fetch("https://zphantom.com/api/tempmail/inbox", {
  method: "POST",
  headers: { "X-API-Key": "zpk_your_key" },
});
const { address, token } = await r.json();
// Use token as: Authorization: Bearer <token>
HTTP 201 — { "address": "abc123xyz@mail.zphantom.com", "token": "tok_xxxxxxxxxxxxxxxxxxxxxx", "expires": "2026-03-23T14:00:00+00:00", "domain": "mail.zphantom.com" }

Temp Mail API

Programmatic disposable email inboxes. Free with API key. Always free at /tempmail in the browser.

Quick start: Use POST /api/tempmail/inbox — one call, get address + token instantly. Or use the manual 2-step flow: create accountget token → use Authorization: Bearer TOKEN on all inbox calls.
POST /api/tempmail/accounts Create inbox — free
ParameterTypeRequiredDescription
addressstringrequiredFull email address e.g. test123@yourdomain.com
passwordstringrequiredPassword for this mailbox (min 8 chars)
curl
Python
JavaScript
curl -X POST https://zphantom.com/api/tempmail/accounts \
  -H "X-API-Key: zpk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"address": "test123@mail.zphantom.com", "password": "MyPass123!"}'
import requests

r = requests.post(
    "https://zphantom.com/api/tempmail/accounts",
    headers={"X-API-Key": "zpk_your_key"},
    json={"address": "test123@mail.zphantom.com", "password": "MyPass123!"},
)
print(r.status_code)  # 201 = created
const r = await fetch("https://zphantom.com/api/tempmail/accounts", {
  method: "POST",
  headers: { "X-API-Key": "zpk_your_key", "Content-Type": "application/json" },
  body: JSON.stringify({ address: "test123@mail.zphantom.com", password: "MyPass123!" }),
});
// 201 = created
HTTP 201 Created
POST /api/tempmail/token Authenticate — get Bearer token
ParameterTypeRequiredDescription
addressstringrequiredThe email address you created
passwordstringrequiredThe password you set
curl -X POST https://zphantom.com/api/tempmail/token \
  -H "X-API-Key: zpk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"address": "test123@mail.zphantom.com", "password": "MyPass123!"}'
{ "token": "tok_xxxxxxxxxxxxxxxxxxxxxx" }
GET /api/tempmail/messages List messages — free
curl https://zphantom.com/api/tempmail/messages \
  -H "Authorization: Bearer tok_xxx" \
  -H "X-API-Key: zpk_your_key"
{ "messages": [ { "id": "msg_abc123", "from": {"address": "noreply@github.com"}, "subject": "Verify your email", "seen": false, "createdAt": "2026-03-22T14:02:11Z" } ], "total": 1 }
GET /api/tempmail/messages/latest Latest message + OTP — free

Get the newest message with full body and auto-detected OTP/code — no need to list messages first. Optionally pass ?wait=N (0–30 seconds) to poll until a new message arrives.

ParameterTypeRequiredDescription
waitintegeroptionalSeconds to poll if inbox empty (0–30, default 0). Set to 10–20 when waiting for OTP emails.
curl
Python
JavaScript
# Wait up to 20s for an OTP email to arrive
curl "https://zphantom.com/api/tempmail/messages/latest?wait=20" \
  -H "Authorization: Bearer tok_xxx" \
  -H "X-API-Key: zpk_your_key"
import requests

r = requests.get(
    "https://zphantom.com/api/tempmail/messages/latest",
    headers={
        "Authorization": "Bearer tok_xxx",
        "X-API-Key": "zpk_your_key",
    },
    params={"wait": 20},   # poll up to 20s for a new email
)
msg = r.json()
if msg["found"]:
    print("OTP:", msg["otp"])      # e.g. "847291"
    print("Text:", msg["text"])    # full plain-text body
else:
    print("No messages yet")
const r = await fetch(
  "https://zphantom.com/api/tempmail/messages/latest?wait=20",
  { headers: { "Authorization": "Bearer tok_xxx", "X-API-Key": "zpk_your_key" } }
);
const msg = await r.json();
if (msg.found) {
  console.log("OTP:", msg.otp);    // "847291"
  console.log("Body:", msg.text);
}
// Message found: { "found": true, "id": "msg_abc123", "from": {"address": "noreply@github.com"}, "subject": "Verify your account", "text": "Your code is 847291", "html": "<p>Your code is <b>847291</b></p>", "otp": "847291", "createdAt": "2026-03-22T14:02:11Z" } // Inbox empty: {"found": false}
GET /api/tempmail/messages/{id} Read message body — free
curl https://zphantom.com/api/tempmail/messages/msg_abc123 \
  -H "Authorization: Bearer tok_xxx" \
  -H "X-API-Key: zpk_your_key"
{ "id": "msg_abc123", "from": {"address": "noreply@github.com"}, "subject": "Verify your email", "text": "Your code is 847291", "html": "<p>Your code is <b>847291</b></p>", "createdAt": "2026-03-22T14:02:11Z" }
DELETE /api/tempmail/accounts/{id} Delete inbox — free

Uses your Bearer token for auth. The {id} in the path can be any value — account is identified by your token.

curl -X DELETE https://zphantom.com/api/tempmail/accounts/me \
  -H "Authorization: Bearer tok_xxx" \
  -H "X-API-Key: zpk_your_key"
HTTP 204 No Content

OCR API

Extract text from images and PDFs. 1 credit per call. Supports JPG, PNG, TIFF, BMP, PDF. Always free at /ocr in the browser.

POST /api/ocr Extract text — 1 credit
ParameterTypeRequiredDescription
fileFilerequiredImage or PDF to extract text from
langstringoptionalLanguage code (default: eng). E.g. ara, fra, deu
curl
Python
curl -X POST https://zphantom.com/api/ocr \
  -H "X-API-Key: zpk_your_key" \
  -F "file=@invoice.png" \
  -F "lang=eng"
import requests

r = requests.post(
    "https://zphantom.com/api/ocr",
    headers={"X-API-Key": "zpk_your_key"},
    files={"file": open("invoice.png", "rb")},
    data={"lang": "eng"},
)
data = r.json()
print(data["text"])   # extracted text
{ "text": "Invoice #1234\nDate: 2026-03-21\nTotal: $99.00", "confidence": 0.94, "credits_used": 1 }