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
| Free | Pro, $9/mo | |
|---|---|---|
| Per operation | 5MB per file, 20MB per request | 30MB per request |
| Files per merge | 10 | 50 |
| Rate limit | 15 req/min per account, or per IP address without a key | 60 req/min per account |
| Daily operations | 3 per account, shared by every key and by both REST and MCP; without a key, per IP address, shared with the website | Unlimited |
| Output branding | Epublys credit in output | None |
| AI cover generation | Not available | Included |
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
| Field | Type | Notes |
|---|---|---|
filesrequired |
array of string | Base64-encoded EPUB files |
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 | |
author |
string | |
dividers |
boolean |
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.
| Field | Type | Notes |
|---|---|---|
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 |
chapterEnd |
integer | Last chapter to include (inclusive) |
keepMetadata |
boolean | Preserve the original author, publisher and description in the output |
POST
/v1/compress
Compress EPUB
| Field | Type | Notes |
|---|---|---|
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 | |
stripUnused |
boolean |
POST
/v1/metadata
Read EPUB metadata
| Field | Type | Notes |
|---|---|---|
filerequired |
string | Base64-encoded EPUB |
POST
/v1/metadata/edit
Edit EPUB metadata
Absent fields are left untouched; an explicit empty string clears a field.
| Field | Type | Notes |
|---|---|---|
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
| Field | Type | Notes |
|---|---|---|
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 | |
margins |
integer | Page margin in points; out-of-range values fall back to 60 |
fontFamily |
string | |
fontSize |
integer | |
pageNumbers |
boolean |
POST
/v1/pdf-to-epub
Convert PDF to EPUB
| Field | Type | Notes |
|---|---|---|
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) |
chapterMode |
string | |
pagesPerChapter |
integer | Pages per chapter when chapterMode is 'every-n' |
extractImages |
boolean | Pro only — ignored on free tier |
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.
| Field | Type | Notes |
|---|---|---|
filerequired |
string | Base64-encoded .docx |
name |
string | Original filename — used as the title fallback; the output is named after its stem |
title |
string | |
author |
string | |
language |
string | dc:language of the generated EPUB (BCP 47) |
chapterMode |
string | Where chapters start |
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.
| Field | Type | Notes |
|---|---|---|
filesrequired |
array of object | Markdown files, one per chapter, in reading order |
title |
string | |
author |
string | |
language |
string | dc:language of the generated EPUB (BCP 47) |
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.
| Field | Type | Notes |
|---|---|---|
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 |
POST
/v1/validate
Validate EPUB
| Field | Type | Notes |
|---|---|---|
filerequired |
string | Base64-encoded EPUB |
deepScan |
boolean | |
autoFix |
boolean |
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.
| Field | Type | Notes |
|---|---|---|
description |
string | Visual description of the cover (subject, mood, style) |
title |
string | |
author |
string | |
genre |
string | Book genre — affects style and composition |
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.
| Field | Type | Notes |
|---|---|---|
plan |
string | monthly is $9/month; yearly is $72/year |
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.
| Status | Meaning |
|---|---|
400 | Invalid input — human message in `error`, machine category in `code` |
401 | Invalid, malformed or revoked API key (a request with no key runs the free tier) |
413 | Upload exceeds the per-request total cap |
429 | Rate limited |
500 | Processing failure |
Machine-readable code values:
validationtotal_too_largerate_limiteddaily_limitedpro_requiredcustomer_id_collisionunauthorizedunauthenticatedunavailabletimeoutinternalcsrfupload_interruptednot_foundunsupported_cjkunsupported_arabicunsupported_hebrewunsupported_thaiunsupported_devanagariunsupported_cyrillicunsupported_greekunsupported_other
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:
merge_epubsplit_epubcompress_epubread_epub_metadataedit_epub_metadataepub_to_pdfpdf_to_epubmarkdown_to_epubdocx_to_epubepub_to_markdownvalidate_epubgenerate_coverupgrade_to_pro
Machine-readable
If you are pointing an agent or a code generator at Epublys, use these instead of scraping this page:
- /openapi.json — OpenAPI 3.1.0 spec for the REST API, version 1.0.1. This page is generated from it.
- /llms.txt — short site summary in the llms.txt convention.
- /llms-full.txt — the same reference as plain text, sized for a model's context window.
- MCP server card — transport, auth and capabilities for MCP clients.
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.