Documentation

Epublys is callable from your own code. Every tool on the site is available over a REST API and over MCP, with one optional API key that works on both. Files go up as base64 JSON and come back the same way. Nothing is stored.

Quickstart

Try it without an account: drop the Authorization line and the call runs on the free tier. For your own allowance, create a key at your account page — keys look like epl_... and take about ten seconds to issue. The free tier needs no card.

The payload goes in a file because a real book's base64 is larger than a shell argument can hold (Linux ARG_MAX is about 2MB; a 5MB EPUB encodes to 6.7MB). The portable form strips newlines with tr because macOS base64 has no -w flag.

base64 < book.epub | tr -d '\n' > book.b64
jq -n --rawfile f book.b64 '{file: $f, level: 6}' > body.json
curl -s -X POST https://epublys.com/v1/compress \
  -H "Authorization: Bearer epl_your_key_here" \
  -H "Content-Type: application/json" \
  --data-binary @body.json | jq -r .file | base64 -d > smaller.epub
import base64, requests
key = "epl_your_key_here"
src = base64.b64encode(open("book.epub", "rb").read()).decode()
r = requests.post("https://epublys.com/v1/compress",
                  headers={"Authorization": f"Bearer {key}"},
                  json={"file": src, "level": 6})
open("smaller.epub", "wb").write(base64.b64decode(r.json()["file"]))

A successful call returns a JSON envelope with the output file base64-encoded in file, plus filename and contentType.

Need an input you can redistribute? The EPUB validation lab provides an original control book, single-fault examples, checksums and recorded EPUBCheck results. Use the control for conversion tests; the faulty variants teach validation behavior.

Authentication

A key is optional. Without one, every call runs on the free tier, counted per IP address together with the website. Send a key as a bearer token to carry the allowance with your account; Pro and /v1/upgrade need one. A malformed, unknown or revoked key returns 401; it is never treated as no key.

Authorization: Bearer epl_your_key_here

The same key authenticates both the REST API and the MCP server. You can revoke a key at any time from your account page, and a revoked key stops working immediately.

Limits

FreePro, $9/mo
Per operation5MB per file, 20MB per request30MB per request
Files per merge1050
Rate limit15 req/min per account, or per IP address without a key60 req/min per account
Daily operations3 per account, shared by every key and by both REST and MCP; without a key, per IP address, shared with the websiteUnlimited
Output brandingEpublys credit in outputNone
AI cover generationNot availableIncluded

Two tools have a larger free per-file cap because their inputs are typically larger: pdf-to-epub at 10MB and split at 15MB. The 30MB Pro figure is the ceiling the upload gate actually enforces on the whole request, so it is the number to size against. See pricing for the full comparison.

The MCP server has its own rate-limit bucket of the same size as REST, so an agent using both channels is not competing with itself. GET /v1/usage reports the remaining daily allowance and is not itself metered — a caller can check before spending. Every metered success also carries an X-Epublys-Daily-Remaining header.

REST endpoints

Base URL https://epublys.com/v1. 14 endpoints, each taking and returning application/json; the HTTP verb is shown on each card below. File fields are base64 strings without a data-URI prefix.

POST /v1/merge

Merge multiple EPUBs

FieldTypeNotes
filesrequired array of string Base64-encoded EPUB files
min 2 items
names array of string Original filenames, in the same order as files — the output is named after them ("A + B.epub", or "A + N more.epub" past two); without them it is merged.epub
title string max 300 chars
author string max 300 chars
dividers boolean default true

POST /v1/split

Split EPUB into chapters, or pull a chapter range out as one EPUB

With chapterStart and/or chapterEnd the result is ONE EPUB (contentType application/epub+zip) of exactly those chapters, in order, with the book’s metadata, a table of contents limited to them and the fonts and images they use. Without a range the result is a ZIP (application/zip) holding one EPUB per chapter.

FieldTypeNotes
filerequired string Base64-encoded EPUB
name string Original filename — the output is named after its stem (e.g. "Book.epub" gives "Book (compressed).epub"); without it the output keeps a fixed name
chapterStart integer First chapter to include (1-indexed). Giving either bound returns one EPUB of the range instead of a ZIP
range 1 to any
chapterEnd integer Last chapter to include (inclusive)
range 1 to any
keepMetadata boolean Preserve the original author, publisher and description in the output
default true

POST /v1/compress

Compress EPUB

FieldTypeNotes
filerequired string Base64-encoded EPUB
name string Original filename — the output is named after its stem (e.g. "Book.epub" gives "Book (compressed).epub"); without it the output keeps a fixed name
level integer default 6 · range 1 to 9
stripUnused boolean default false

POST /v1/metadata

Read EPUB metadata

FieldTypeNotes
filerequired string Base64-encoded EPUB

POST /v1/metadata/edit

Edit EPUB metadata

Absent fields are left untouched; an explicit empty string clears a field.

FieldTypeNotes
filerequired string Base64-encoded EPUB
name string Original filename — the output is named after its stem (e.g. "Book.epub" gives "Book (compressed).epub"); without it the output keeps a fixed name
title string —
author string —
authors string Comma-separated contributor list
language string —
publisher string —
description string —
series string —
seriesPosition string Position within the series (e.g. "2")
subjects string Comma-separated subject/genre tags
date string Publication date (ISO 8601)
isbn string —
cover string Base64-encoded cover image — JPEG or PNG, 5MB max decoded

POST /v1/epub-to-pdf

Convert EPUB to PDF

FieldTypeNotes
filerequired string Base64-encoded EPUB
name string Original filename — the output is named after its stem (e.g. "Book.epub" gives "Book (compressed).epub"); without it the output keeps a fixed name
pageSize string one of a4, letter · default "a4"
margins integer Page margin in points; out-of-range values fall back to 60
default 60
fontFamily string one of serif, sans · default "serif"
fontSize integer default 11 · range 6 to 48
pageNumbers boolean default true

POST /v1/pdf-to-epub

Convert PDF to EPUB

FieldTypeNotes
filerequired string Base64-encoded PDF
name string Original filename — the output is named after its stem (e.g. "Book.epub" gives "Book (compressed).epub"); without it the output keeps a fixed name
language string dc:language of the generated EPUB (BCP 47)
default "en"
chapterMode string one of auto, every-n, single · default "auto"
pagesPerChapter integer Pages per chapter when chapterMode is 'every-n'
default 10
extractImages boolean Pro only — ignored on free tier
default true

POST /v1/docx-to-epub

Convert a Word document (DOCX) to EPUB

Chapters split on the document’s top heading level by default. Bold/italic, lists, tables, inline images, hyperlinks and footnotes are kept; the title and author come from the document properties unless given here.

FieldTypeNotes
filerequired string Base64-encoded .docx
name string Original filename — used as the title fallback; the output is named after its stem
title string max 300 chars
author string max 300 chars
language string dc:language of the generated EPUB (BCP 47)
default "en"
chapterMode string Where chapters start
one of headings, page-breaks, single · default "headings"

POST /v1/markdown-to-epub

Build an EPUB from Markdown files

One Markdown file per chapter, in array order. Chapter titles come from each file’s first heading, falling back to its name.

FieldTypeNotes
filesrequired array of object Markdown files, one per chapter, in reading order
min 1 items
title string max 300 chars
author string max 300 chars
language string dc:language of the generated EPUB (BCP 47)
default "en"

POST /v1/epub-to-markdown

Convert EPUB to Markdown

Returns a ZIP containing one Markdown file per chapter plus frontmatter, and the extracted images unless includeImages is false.

FieldTypeNotes
filerequired string Base64-encoded EPUB
name string Original filename — the output is named after its stem (e.g. "Book.epub" gives "Book (compressed).epub"); without it the output keeps a fixed name
includeImages boolean Include extracted images in the ZIP
default true

POST /v1/validate

Validate EPUB

FieldTypeNotes
filerequired string Base64-encoded EPUB
deepScan boolean default true
autoFix boolean default false

POST /v1/generate-cover Pro

Generate AI book cover (Pro only)

Generates a book cover image using FLUX from a description or a title (either is sufficient). Pro tier required — free-tier keys receive 403. Returns a base64-encoded JPEG.

FieldTypeNotes
description string Visual description of the cover (subject, mood, style)
max 2000 chars
title string max 200 chars
author string max 200 chars
genre string Book genre — affects style and composition
one of fantasy, romance, thriller, sci-fi, literary, non-fiction, horror, children, poetry, minimalist · default "literary"
seed integer Optional seed for reproducible output

POST /v1/upgrade

Get a Pro checkout link for this account

Returns a Stripe checkout URL for the account that owns the API key, so a programmatic caller refused with `daily_limited` can resolve it rather than only report a pricing URL. The email is taken from the authenticated key and never from the body — this cannot be used to pay for another account. Creates no charge by itself, and is not counted against the free daily allowance. Mirrors the `upgrade_to_pro` MCP tool.

FieldTypeNotes
plan string monthly is $9/month; yearly is $72/year
one of monthly, yearly · default "monthly"

GET /v1/usage

Read this account's remaining allowance

Daily operations and AI-cover quota for the account that owns the API key. Not metered and never counted against the daily allowance, so a caller can check before spending. The daily allowance is per ACCOUNT and shared by every key and by both REST and MCP. Without a key, the allowance is per IP address, shared with the website.

No parameters.

Errors

Every failure returns the same envelope: success: false, a human-readable error, and a machine-readable code. A 429 also carries a Retry-After header telling you how many seconds until the window resets.

Every call is synchronous — there are no webhooks and no polling loop. Calls time out after 25 seconds; cover generation allows 40 seconds. Keys have no scopes and no expiry; revoke them from your account page. Resetting your password revokes every key on the account. A free account can hold 5 keys; Pro allows 20.

StatusMeaning
400Invalid input — human message in `error`, machine category in `code`
401Invalid, malformed or revoked API key (a request with no key runs the free tier)
413Upload exceeds the per-request total cap
429Rate limited
500Processing failure

Machine-readable code values:

Use it from an AI assistant

The same tools are exposed over the Model Context Protocol at https://epublys.com/mcp, over Streamable HTTP. No key is needed for the free tier; add one for Pro or to carry the allowance with your account.

Claude Code:

claude mcp add --transport http epublys https://epublys.com/mcp

Claude Desktop — add it through Settings, Connectors, or bridge it with mcp-remote:

{
  "mcpServers": {
    "epublys": {
      "command": "npx",
      "args": ["mcp-remote@latest", "https://epublys.com/mcp"]
    }
  }
}

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "epublys": {
      "url": "https://epublys.com/mcp"
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "epublys": {
      "type": "http",
      "url": "https://epublys.com/mcp"
    }
  }
}

Pro and account allowance: add a header to each shape. Claude Code: --header "Authorization: Bearer epl_...". mcp-remote args: add "--header", "Authorization: Bearer epl_...". Cursor/VS Code: add "headers": {"Authorization": "Bearer epl_..."}.

The auto-discovery card lives at /.well-known/mcp/server-card.json.

tools/list returns 13 tools:

Machine-readable

If you are pointing an agent or a code generator at Epublys, use these instead of scraping this page:

What's new

The API and the tools behind it change often. The changelog lists every release, newest first, and you can follow it by RSS.

2026-10-21
Clearer Kindle format guidance
Read the changelog →