Docs
Official Documentation

Scrivibe — Complete Guide

Everything you need to write, generate, publish and share AI-powered eBooks. From your first book to full programmatic integration.

Flask + PostgreSQL Claude AI (Anthropic) Stripe Payments EPUB / PDF / DOCX REST API + MCP

Overview

Scrivibe is an AI-powered eBook generation platform that lets anyone — from first-time writers to AI agents — produce professional, multi-chapter eBooks in minutes. It combines Anthropic's Claude language models with a robust EPUB pipeline, a token-based economy, and full developer integrations.

AI Book Generation

Generate complete multi-chapter books with narrative continuity, research backing, and genre-aware style.

Cover Art

Auto-generates a professional book cover proposal using OpenAI gpt-image-2 after the book framework is built.

Video Trailer

Creates a 1080×1920 portrait MP4 book trailer with AI scenes, voiceover and music. Cinematic mode via Runway.

Multi-Format Export

Download your book as EPUB, PDF, DOCX, or plain TXT — ready for Kindle, iBooks and self-publishing.

Share & Bookshelf

Share to Kindle, generate 72-hour download links, post to Amazon Bookshelf across 14 regional stores.

Developer API + MCP

Full REST B2A API for programmatic generation plus an MCP server so AI agents can use Scrivibe natively.

Quick Start

You can create your first eBook in under 5 minutes without registering. Here is the full flow:

Guest vs Registered Users

Feature Guest Registered
Initial tokensWelcome balanceWelcome balance + signup bonus
Book generation Yes Yes
EPUB download Yes Yes
My Books dashboard Yes (browser-based) Yes (account-linked)
Buy tokens No Yes (Stripe)
First Book Guide reward No Token reward
Book cover generation Yes Yes
Book trailers Yes Yes
Shareable download links 72-hour links 72-hour links
Bookshelf / Amazon listing Yes Yes
Identity persistenceCookie (visitor_id)Account + session
Guest Identity

Guests are identified by a signed visitor_id cookie stored in the browser. Books and token balances are preserved as long as the cookie persists. Clearing browser data will lose the guest identity — register to secure your work.

Token Economy

Scrivibe uses an internal token currency for every AI action. Tokens are consumed when content is generated; they are never refunded after successful generation starts.

How tokens are assigned

EventTokens
New guest visit (first-ever)Welcome balance
Account registration bonusBonus tokens
First Book Guide completionToken reward
Purchasing a token pack (Stripe)Varies by pack

Buying Tokens

Registered users can purchase additional token packs through Stripe Checkout. Go to Profile → Buy Tokens or navigate to /tokens/buy.

Secure Payments

All payments are processed by Stripe. Scrivibe verifies every webhook signature — no token is credited without a verified Stripe event.

Rewards & Bonuses

Registered users can earn free tokens through in-app activities.

RewardTokensHow to earn
First Book Guide Token reward Complete all steps in the First Book Guide — fill in book details, generate framework, generate chapters, download EPUB.
Share Reward Varies Share your completed book via social media or email using the Share feature. Reward credited once per book per platform.
Signup Bonus Bonus tokens Automatic on account registration.

Book Generation

The core feature of Scrivibe. The generation pipeline runs in two phases: framework (outline + chapter plan) and content (full prose per chapter).

Book Configuration Fields

FieldRequiredDescription
titlerequiredThe book's title
authoroptionalAuthor name (appears on cover and EPUB metadata)
book_descriptionrequiredShort premise / blurb — the single source of truth for AI context
genrerequiredPrimary genre (e.g. Literature & Fiction, Non-Fiction, Sci-Fi)
subject_themeoptionalSub-theme within the genre (e.g. Romance, Thriller, Biography)
target_audienceoptionale.g. Young Adult, Business Professionals
toneoptionale.g. Humorous, Dark, Inspirational
narrative_voiceoptionalFirst person, Third person limited, Omniscient…
chapter_countrequiredNumber of chapters (1–50)
languageoptionalISO 639-1 code — default en. 15 languages supported.
unique_elementsoptionalCustom instructions or distinctive elements for the AI
content_restrictionsoptionalTopics or themes to avoid

Generation Pipeline

  1. Web Research — DuckDuckGo + trafilatura scrape relevant sources automatically for non-fiction genres.
  2. Framework Generation — Claude creates chapter titles, summaries, character bibles and narrative continuity data.
  3. Cover Proposal — OpenAI gpt-image-2 generates a cover image from the book premise immediately after framework.
  4. Chapter Prose — Each chapter is generated in sequence using the narrative continuity system to ensure smooth transitions.
  5. EPUB Assemblyebooklib compiles all chapters, metadata, cover image, and optional front/back matter into a valid EPUB 3 file.

Anti-Hallucination & Continuity

The Narrative Continuity System stores chapter context (character states, plot threads, established facts) as each chapter is generated. This context is injected into subsequent chapter prompts, preventing contradictions and ensuring consistent storytelling across the entire book.

Circuit Breaker & Stuck Tasks

A circuit breaker pattern monitors generation health. Tasks that stop responding are automatically detected and cleaned up. Truncated chapters from interrupted sessions are repaired on next startup.

Cover Generation

Scrivibe automatically generates a cover image after the AI framework is built. You can also request a new cover manually at any time from the book view.

Landing Page Tool

The Book Cover Generator landing page (/book-cover-generator) lets you generate standalone covers for any book concept — separate from the eBook generation flow.

Export Formats

Every completed book can be exported in multiple formats from the My Books dashboard or the book view.

FormatEndpointNotes
EPUB GET /book/<id>/download Primary format. Valid EPUB 3 with cover, metadata, chapters. Works in Kindle app, iBooks, Kobo, etc.
PDF GET /book/<id>/download?format=pdf Print-ready PDF via utils/pdfgen.py.
DOCX GET /book/<id>/download?format=docx Microsoft Word format via utils/docxgen.py. Editable in any word processor.
TXT GET /book/<id>/download?format=txt Plain text, all chapters concatenated.
Send to Kindle

The Share modal includes a "Send to Kindle" option that delivers the EPUB directly to a registered Kindle email address using AgentMail's email delivery.

My Books Dashboard

The My Books page (/my-books) is the central hub for managing all your generated content.

Sharing & Bookshelf

Shareable Download Links

Registered users can generate tokenized 72-hour download links that let anyone download the EPUB without being logged in. These links are single-use and expire automatically.

Web Share API

On supported devices (iOS Safari, Android Chrome), the Share modal triggers the native OS share sheet for easy sharing to WhatsApp, Twitter, etc.

Amazon Bookshelf

The Bookshelf feature lets you submit your completed book to the public Amazon Bookshelf — 14 regional stores (US, UK, DE, FR, ES, IT, NL, JP, BR, CA, MX, AU, IN, SE). The system validates ASINs and generates affiliate URLs automatically.

Bookshelf is for Listings Only

The Bookshelf feature creates a listing reference only. Scrivibe does not upload your book to Amazon — you must publish it there yourself first. The feature is for tracking and linking your published work.

Video Book Trailer

Scrivibe generates a 1080×1920 portrait MP4 video trailer for completed books. Two quality tiers are available.

StandardCinematic
Scene generationOpenAI gpt-image-2OpenAI gpt-image-2
Scene animationStatic (Ken Burns effect)Runway Gen-4 Turbo (real motion)
VoiceoverMultiple AI voice optionsMultiple AI voice options
Background music
Token costToken cost appliesToken cost applies
Runway API key required User-supplied
Languages15 localized voice/text options15 localized voice/text options

How to generate a trailer

  1. Open a completed book in My Books.
  2. Click "Generate Trailer".
  3. Choose Standard or Cinematic (requires your Runway API key for Cinematic).
  4. Optionally customize voice, tagline, and music mood.
  5. Click "Generate". Token cost is deducted immediately.
  6. The trailer generates asynchronously. A progress indicator is shown. Download the MP4 when ready.
Refund Policy

If a trailer generation fails after tokens have been deducted, the system automatically refunds the tokens to your balance. Check your token transaction history in the Profile page.

Multilingual Support

Scrivibe supports 15 languages for both the UI and book generation. The interface automatically detects browser language preferences.

🇺🇸 English 🇪🇸 Español 🇫🇷 Français 🇩🇪 Deutsch 🇮🇹 Italiano 🇵🇹 Português 🇷🇺 Русский 🇯🇵 日本語 🇨🇳 中文 🇰🇷 한국어 🇸🇦 العربية 🇳🇱 Nederlands 🇵🇱 Polski 🇸🇪 Svenska 🇹🇷 Türkçe

Language-specific landing pages are available at /<lang_code>/ (e.g. /es/, /fr/). Books generated in a specific language will use that language's writing conventions and narrative style.


Developer

B2A REST API

The Book-to-Agent API (/v1/) is a REST interface for programmatic eBook generation. It is designed for AI agents, automation pipelines, and developer integrations.

Authentication — RapidAPI only

The B2A API is exclusively accessible via RapidAPI. Direct calls to /v1/ without a valid RapidAPI proxy header are rejected with 401 Unauthorized. Subscribe on RapidAPI to get your X-RapidAPI-Key — no Scrivibe account required.

Base URL

https://www.scrivibe.com/v1
GET /v1/genres

Returns a list of all supported genres and their subject themes. No authentication required.

{
  "genres": [
    {
      "id": "literature_fiction",
      "name": "Literature & Fiction",
      "themes": ["Romance", "Thriller", "Mystery", ...]
    },
    ...
  ]
}
POST /v1/books

Enqueues a new book generation job. Returns a job_id for polling.

ParameterTypeStatusDescription
titlestringrequiredBook title
authorstringoptionalAuthor name (default: Unknown Author)
descriptionstringoptionalBook blurb / premise
genrestringoptionalGenre ID from GET /v1/genres
chapter_countintegeroptional*1–50. AI picks titles and summaries. Mutually exclusive with chapters.
chaptersarrayoptional*Pre-defined chapter outlines. Each item: {title, summary}. Max 50.
generate_coverbooleanoptionalDefault true. Set false to skip cover generation.
languagestringoptionalISO 639-1 code. Default en.
tonestringoptionalWriting tone
target_audiencestringoptionalIntended reader demographic
narrative_voicestringoptionalPOV choice
unique_elementsstringoptionalSpecial instructions for the AI
content_restrictionsstringoptionalTopics to avoid

* Provide exactly one of chapter_count or chapters.

// Request (via RapidAPI gateway)
POST /v1/books
X-RapidAPI-Key: YOUR_RAPIDAPI_KEY
X-RapidAPI-Host: scrivibe.p.rapidapi.com
Content-Type: application/json

{
  "title": "The Lost Algorithm",
  "genre": "science_fiction",
  "chapter_count": 8,
  "description": "A programmer discovers an AI that predicts human decisions...",
  "language": "en"
}

// Response 202 Accepted
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "queued"
}
GET /v1/books/{job_id}

Poll for job status and generation progress.

// Response
{
  "job_id": "550e8400-...",
  "status": "generating",  // queued | generating | building_epub | completed | failed | expired
  "progress": 0.62,
  "current_step": "Generating chapter 5 of 8...",
  "chapters_done": 5,
  "chapters_total": 8
}

Recommended polling interval: every 5–10 seconds. Do not poll faster than 2 seconds.

GET /v1/books/{job_id}/epub

Download the completed EPUB file. Returns application/epub+zip. Only available when status == "completed". Files expire after a TTL period — download promptly.

TTL Expiry

EPUB files are stored temporarily. When the job status is expired, the file is no longer available. Always download immediately after completed.

Rate Limits

Rate limiting and quota enforcement are handled by RapidAPI. If you receive a 429 Too Many Requests response, upgrade your RapidAPI plan or wait for your quota to reset. Scrivibe does not impose additional per-key limits on top of RapidAPI's controls.

OpenAPI Spec

A full OpenAPI 3.0 spec is available at /static/openapi.yaml. Import it into Postman, Insomnia, or any OpenAPI client.

AI Agents

MCP Server

Scrivibe implements the Model Context Protocol (MCP) — a standard for AI agents to use external tools natively. This means Claude, GPT, and other MCP-compatible agents can use Scrivibe without a custom integration.

MCP Endpoint

POST https://www.scrivibe.com/mcp

The endpoint accepts JSON-RPC 2.0 calls. The following tools are exposed:

ToolDescriptionAuth
list_genres Returns all available genres and subject themes. Use this to pick valid genre IDs before calling generate_ebook. None
generate_ebook Starts an eBook generation job. Same parameters as POST /v1/books. Includes an in-chat Stripe Checkout payment gate for $0.45/chapter. Stripe payment
get_job_status Polls the current status and progress of an in-flight generation job. None
download_epub_url Returns a temporary signed download URL for the completed EPUB. Valid for 72 hours. None

Payment Gate

When an AI agent calls generate_ebook without an API key, the server returns a Stripe Checkout URL embedded in the JSON-RPC response. The user must complete payment ($0.45 per chapter) before the job is enqueued. This enables monetized MCP usage without pre-registration.

Example MCP call (JSON-RPC)

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "id": 1,
  "params": {
    "name": "generate_ebook",
    "arguments": {
      "title": "The Future of AI",
      "genre": "nonfiction",
      "chapter_count": 5,
      "description": "An accessible guide to how AI is reshaping every industry."
    }
  }
}
MCP Guide Page

A detailed MCP integration guide is available at /mcp-guide, including setup instructions for Claude Desktop and compatible MCP clients.

Supported Genres

Use these IDs in the genre field of book creation requests. For a live list with all subject themes, call GET /v1/genres.

Genre IDDisplay NameExample Themes
literature_fictionLiterature & FictionRomance, Thriller, Mystery, Literary Fiction
science_fictionScience Fiction & FantasySpace Opera, Cyberpunk, Fantasy, Dystopian
nonfictionNon-FictionBiography, Self-Help, Business, History
childrenChildren's BooksPicture Books, Middle Grade, Young Adult
horrorHorrorSupernatural, Psychological, Gothic
romanceRomanceContemporary, Historical, Paranormal
mystery_thrillerMystery & ThrillerDetective, Cozy Mystery, Legal Thriller
historicalHistorical FictionAncient, Medieval, WW2, Victorian
businessBusiness & FinanceEntrepreneurship, Investing, Leadership
self_helpSelf-Help & Personal DevelopmentProductivity, Mindfulness, Relationships

Frequently Asked Questions

Can I edit the generated chapters?

You can preview each chapter and regenerate it as many times as you like — adjusting tone, length, or focus via the book settings before each run. If you need to make text-level changes, download the chapter (EPUB, PDF, DOCX, or TXT) and edit it in your preferred writing tool.

What happens if generation is interrupted mid-way?

The system uses progressive saving — each chapter is written to the database as it completes. If generation is interrupted, you will retain all chapters generated up to that point. The startup repair system also automatically fixes truncated chapters on the next server start.

Can I generate books in languages other than English?

Yes. Set the language field to any supported ISO 639-1 code. Claude will write prose, chapter titles, and meta content in the specified language.

My tokens were deducted but the book failed. Will I get them back?

Tokens are consumed per chapter as they are generated — they are not pre-deducted in a lump. If a trailer or cover generation fails entirely before completing, the system issues an automatic refund to your balance.

What AI model powers Scrivibe?

Book generation uses Anthropic Claude Sonnet 4.5 for standard generation and Claude Opus 4.6 for premium (when configured). Cover generation uses OpenAI gpt-image-2. Cinematic trailer animation uses Runway Gen-4 Turbo.

How do I get a B2A API key?

Subscribe on RapidAPI. A free tier is available — no Scrivibe account required. Once subscribed, your X-RapidAPI-Key is shown on the RapidAPI dashboard and auto-injected into every code snippet. The B2A API does not issue direct API keys.

Is there a chapter limit?

The current hard limit is 50 chapters per book (both web UI and API). There is no minimum; a 1-chapter book (short story or guide) is valid.

Can I use the MCP server with Claude Desktop?

Yes. Point your Claude Desktop MCP config to https://www.scrivibe.com/mcp. Full setup instructions are at /mcp-guide.

Are there rate limits?

Yes. The B2A API is rate-limited by RapidAPI according to your subscription plan. The web app and public endpoints are rate-limited by IP. If you receive a 429 Too Many Requests response on the API, upgrade your RapidAPI plan or wait for your quota window to reset.