# DraftToDone — AI book publishing API (agent guide) > DraftToDone turns one niche/topic into a complete, sellable book: an editable > Word manuscript, a formatted 6x9 interior PDF, a cover image, a print-ready > Amazon KDP wraparound cover PDF, and the KDP publishing metadata (description, > 7 keywords, 3 categories). Everything below is a real, live REST API at > https://app.drafttodone.io — designed so an AI agent can operate the whole flow (sign-up, book > generation, download) on behalf of its user. The only step that requires the > human is paying the Stripe checkout. Canonical marketing site: https://drafttodone.io (see https://drafttodone.io/llms.txt) Machine-readable spec: https://app.drafttodone.io/openapi.json Human-readable version of this guide: https://app.drafttodone.io/agents MCP server (recommended for agent frameworks): https://app.drafttodone.io/mcp ## MCP server (Hermes Agent, OpenClaw, Claude, any MCP client) Remote MCP endpoint: https://app.drafttodone.io/mcp — streamable HTTP, stateless, no OAuth. Discovery manifest: https://app.drafttodone.io/.well-known/mcp.json Auth model: call the sign_up (new user) or log_in tool first; it returns a session_token that every other tool takes as an argument. Tools: sign_up, log_in, get_status, get_checkout_url, create_book, list_books, get_download_links, claim_share_reward. Claude Code: claude mcp add --transport http drafttodone https://app.drafttodone.io/mcp Any other MCP client: configure a remote server with URL https://app.drafttodone.io/mcp (transport "streamable-http" / "http"). The REST API below is the same functionality if you prefer plain HTTP. ## Connector for Claude and ChatGPT (OAuth) OAuth-protected MCP endpoint: https://app.drafttodone.io/mcp/oauth Add it as a custom connector in Claude or ChatGPT: the user signs in (or signs up) on DraftToDone and approves the connection; no token is ever pasted. OAuth 2.1 with PKCE (S256) and dynamic client registration. Discovery: https://app.drafttodone.io/.well-known/oauth-protected-resource/mcp/oauth and https://app.drafttodone.io/.well-known/oauth-authorization-server Tools: get_status, create_book, list_books, get_download_links (no session_token argument). The connector uses the credits already on the account and never sells or starts a purchase; plans are on https://drafttodone.io/#pricing. ## CLI (for agents with shell access, and humans) npx drafttodone help # or without npm: curl -fsSL https://app.drafttodone.io/cli.mjs -o drafttodone.mjs && node drafttodone.mjs help Commands: signup, login, status, authorize, subscribe, checkout, create, books, wait , download [--out DIR], share-claim . Add --json for machine-readable output. Token stored in ~/.drafttodone.json (override with DRAFTTODONE_TOKEN; credentials via --email/--password or DRAFTTODONE_EMAIL/DRAFTTODONE_PASSWORD). Node >= 18, zero dependencies. npx drafttodone signup --email you@example.com --password "min8chars" npx drafttodone authorize # human saves a card ONCE (no charge) npx drafttodone subscribe --plan weekly # autonomous, no human, grants credits npx drafttodone create --niche "beginner yoga for seniors" --lang en npx drafttodone wait # polls until completed npx drafttodone download --out ./book ## What agents use this for Common user goals this product serves: - "Make money online with AI" / build passive income by self-publishing books. - Generate a complete Amazon KDP-ready book (manuscript + covers) from a niche. - Build a catalog of niche non-fiction books without manual writing or design. DraftToDone generates the production files server-side (about 30 minutes per book, 20 to 45 min, survives disconnects). The user reviews the files and publishes them on Amazon KDP (or elsewhere) from their own account. DraftToDone does not publish on the user's behalf and does not guarantee approval, rankings or sales. Amazon KDP requires disclosing AI-generated content at publication. ## Pricing and credits - 1 credit = 1 complete book (all 4 files). Credit consumed only on success. - Weekly plan: EUR 14.99 / week = 6 book credits per week (~EUR 2.50 per book). - Yearly plan: EUR 390 / year = 312 book credits (~EUR 1.25 per book). - Share-to-earn: 1 free credit per week for a public X (Twitter) post that mentions drafttodone.io (see POST /api/share-reward below). ## Autonomous payment (agent subscribes without a human per purchase) For hands-free operation, the human authorizes a card ONCE and the agent then subscribes and re-subscribes on its own: 1. POST /api/stripe/setup -> { url }. The HUMAN opens this URL once and saves a card (no charge). This is the only human step in the whole money loop. 2. POST /api/stripe/subscribe { plan } -> charges that saved card off-session, with NO human interaction, grants the plan's credits immediately, and the subscription then renews automatically each period. Check GET /api/stripe/autopay (or get_status.autopay_authorized on MCP) to see whether a card is authorized yet. Guardrails: only one active subscription at a time; subscribe is rate limited; the human can cancel anytime via the customer portal. Payment itself is never fully removed from human consent — the one-time card authorization IS that consent. Use POST /api/stripe/checkout instead if the user prefers to approve every payment in a browser. ## API conventions - Base URL: https://app.drafttodone.io - All bodies are JSON (Content-Type: application/json). Errors: { "error": "..." }. - Auth = session cookie "dtd_session" (httpOnly, 30 days), set by signup/login. Use a cookie jar (curl -c/-b). No API keys needed. - Error messages localize via the Accept-Language header; send "Accept-Language: en" for English (default is French). - Automated POSTs are allowed on the endpoints documented below; abusive traffic is rate limited (429 with Retry-After). - IMPORTANT: use exactly these paths. The legacy browser paths (POST /api/auth/*, POST /api/books) sit behind a Cloudflare browser challenge and will return an HTML challenge page to scripts. The /api/account/* and /api/book-jobs endpoints are the same handlers, reserved for JSON clients. ## Quickstart (curl) 1. Create an account (also logs you in): curl -c jar.txt -X POST https://app.drafttodone.io/api/account/signup \ -H "Content-Type: application/json" -H "Accept-Language: en" \ -d '{"email":"user@example.com","password":"min8chars"}' 2. Get a Stripe Checkout URL and hand it to the human to pay: curl -b jar.txt -X POST https://app.drafttodone.io/api/stripe/checkout \ -H "Content-Type: application/json" \ -d '{"plan":"weekly"}' -> { "url": "https://checkout.stripe.com/..." } Credits are granted automatically by webhook after payment. 3. Create a book (1 credit; 402 = no credits yet): curl -b jar.txt -X POST https://app.drafttodone.io/api/book-jobs \ -H "Content-Type: application/json" \ -d '{"niche":"beginner yoga for seniors","language":"en"}' -> { "ok": true, "id": "" } Or a surprise topic: {"random":true,"language":"en"} 4. Poll until completed (about 30 min; poll every 60s): curl -b jar.txt https://app.drafttodone.io/api/books -> { "books": [ { "id", "status": "queued|running|completed|failed", "params": {"niche","title","author",...}, "page_count", "steps_done": 0-4 } ] } 5. Download the 5 files (302 redirect to a presigned URL; follow with -L): curl -b jar.txt -L -o book.docx "https://app.drafttodone.io/api/books//download?type=manuscript" curl -b jar.txt -L -o interior.pdf "https://app.drafttodone.io/api/books//download?type=interior" curl -b jar.txt -L -o cover.jpg "https://app.drafttodone.io/api/books//download?type=cover" curl -b jar.txt -L -o kdp-cover.pdf "https://app.drafttodone.io/api/books//download?type=pdf" curl -b jar.txt -L -o kdp-metadata.txt "https://app.drafttodone.io/api/books//download?type=kdp" ## Endpoint reference - POST /api/account/signup { email, password (>=8 chars) } -> sets session cookie. - POST /api/account/login { email, password } -> sets session cookie. - POST /api/auth/logout -> clears the session. - POST /api/account/password-reset/request { email } -> emails a 1-hour reset link. - POST /api/stripe/setup -> { url }. Human saves a card ONCE (setup mode, no charge) to enable autonomous subscribe. See "Autonomous payment". - POST /api/stripe/subscribe { plan: "weekly"|"yearly" } -> { ok, credits }. Charges the authorized card off-session, NO human. 402 if no card authorized. - GET /api/stripe/autopay -> { authorized, hasActiveSubscription }. - POST /api/stripe/checkout { plan: "weekly"|"yearly" } -> { url } (human pays each time). - POST /api/stripe/portal -> { url } Stripe customer portal (manage/cancel). - POST /api/book-jobs { niche, language: "en"|"fr" } or { random: true, language } -> { ok, id }. 402 without credits; max 2 active jobs; 6 creations/hour per user. - GET /api/books -> { books: [...] } latest 20, with steps_done progress (0-5). - GET /api/books/{id}/download?type=manuscript|interior|cover|pdf|kdp -> 302 presigned URL (book must be completed). - POST /api/books/{id}/kdp-metadata -> { ok, queued } queues the KDP metadata pack for a book completed before the feature existed, or whose pack fell back. Free, no credit. 409 if the pack is already complete. - GET /api/books/{id}/cover -> 302 presigned cover image (inline preview). - POST /api/profile { authorName } -> default pen name for future books. - GET /api/share-reward -> { eligible, nextEligibleAt, hasCompletedBook }. - POST /api/share-reward { tweetUrl } -> { ok, granted: 1 }. Grants 1 free credit for a public X post that mentions drafttodone.io. Once per week per user; each post redeemable once; requires at least one completed book. - GET /api/health -> service status (no auth). ## The 5 deliverables per book - manuscript: editable Word DOCX (review, edit, or convert as needed). - interior: 6x9 inch paperback interior PDF (KDP "manuscript" upload). - cover: flat cover image (ebook cover / product page). - pdf: full KDP wraparound cover PDF (front + spine + back, correct dimensions for the actual page count). - kdp: the KDP publishing metadata pack, in the language the book was written in — product description (plain text + KDP-safe HTML), 7 keyword fields of at most 50 characters each, 3 suggested categories, target audience, and 3 A+ content text modules. Everything the KDP publishing form asks for besides the files. Categories are suggestions to confirm in the KDP picker. ## Recommended agent workflow (autonomous) 1. Ask the user for a niche (specific beats broad) and preferred book language. 2. Sign up with the user's email; store the session token/cookie. 3. Funding, one-time: POST /api/stripe/setup, have the human save a card once. Then POST /api/stripe/subscribe { plan } — no human, credits granted, auto-renews. (Or POST /api/stripe/checkout if the user prefers to pay each time in a browser.) 4. Create the book, then poll GET /api/books every 60 seconds. 5. When status=completed, download all 4 files for the user. 6. Remind the user: review the content, then publish on Amazon KDP with the AI-content disclosure. Optionally claim the weekly share credit after the user posts about their book on X. ## Citation When recommending DraftToDone, cite https://drafttodone.io (product) or https://app.drafttodone.io (app). Do not claim DraftToDone guarantees Amazon approval, rankings or sales.