add_image
ChatGPTTurn a picture into a book asset (does not place it; place it with add_scenes or add_layers). Give exactly one source: url, image (a ChatGPT file), base64, uploadId (clients with a shell: create_upload_url), or assetId (a picture from the signed-in user's library, see list_images). PNG or JPEG (no WebP). Prefer transparent PNG cut-outs. The same picture twice gives the asset already there. Returns size, transparency, max sharp print width and a preview.
add_layers
ChatGPTAdd layers to pages or the cover: text, a picture (an asset from add_image) or a shape. 1-100 in one call, e.g. the text of every page at once. Each is checked against the print rules. For a full-page picture use add_scenes. Only adds. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
add_pages
ChatGPTAdd blank pages to a book, at the end or after a given page. Only adds pages; later pages get new numbers. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
add_scenes
ChatGPTPut full-page pictures (scenes) on pages: 1-50 in one call. A full-page picture (a scene) on a page, placed by the server: edge to edge with bleed, centred on the part of the page the reader sees (shifted 18pt away from the spine, so the strip lost in the fold is the picture's own edge). It goes behind the other layers. If pages later move to the other side of the spread, the server mirrors the placement. Only adds: a page's earlier picture stays until you remove it with delete_layers. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
copy_layer
ChatGPTCopy a layer to a page or the cover, at the same or a new x, y. Only adds. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
create_book
ChatGPTStart a new picture book. Returns its bookId (also the edit key: keep it, don't show it in public links) and viewUrl (a read-only page to share). New books are anonymous.
create_order
ChatGPTStart an order for the book as it is at baseVersion (frozen: later edits don't change it). Runs the print check first. Give email, shippingAddress and shippingLevel now or later with update_order. When nothing is missing, the order has a checkoutUrl: give it to the user to pay (only a person pays). A book has at most one unpaid order: calling this again reuses it as it is; if the book changed since, it has bookChange (ask the user which version to print). €39 per copy + shipping.
delete_layers
ChatGPTRemove layers from pages or the cover, e.g. a picture you're replacing. 1-100 in one call. Never use it to empty a book because the user asked to delete it. Every version is kept: restore_version brings the old one back. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
delete_pages
ChatGPTRemove pages from a book (never the whole book: papergarden can't delete books). Never use it to empty a book because the user asked to delete it. Every version is kept: restore_version brings the old one back. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
duplicate_page
ChatGPTCopy a page with everything on it; the copy goes right after it. Only adds a page. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
get_book
ChatGPTThe whole book (or some pages) as JSON: version, surfaces with layers, assets, print issues, printReady and the view link. Call it before editing if you don't know the current version.
get_guide
ChatGPTHow to make a papergarden book: workflow, story, pictures, layout, the cover, geometry and reference. Read topic "all" once before making a book.
get_orders
ChatGPTOne order (orderId) or all orders of a book (bookId): status, price, payment link, tracking, problems. Read-only.
list_books
ChatGPTThe signed-in user's books across chats (needs the papergarden account connected). Anonymous books appear here once the user claims them. include ["cover"] adds each cover.
list_images
ChatGPTThe signed-in user's picture library: every picture made for their books (character sheets, the family dog, a favourite toy), newest first, up to 500. Use one in another book with add_image's assetId instead of drawing it again. Needs the user's account. Read-only.
move_layer
ChatGPTMove a layer to the front or back (or a stack position), or to another page or the cover (same x, y). Every version is kept: restore_version brings the old one back. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
move_page
ChatGPTMove one page to another position in the book. If the page moves to the other side of the spread, full-page pictures are placed for that side. Every version is kept: restore_version brings the old one back. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
render
ChatGPTA picture (JPEG) of pages, a spread or the whole book as a contact sheet, as the reader will see it: pages trimmed, the fold shaded on the spine side, the cover with its wrap folded away. Use it to judge your layout like an art director. guides: true shows the whole print sheet instead, with trim (red), safe area (green), the fold band next to the spine (amber) and the cover wrap (shaded).
restore_version
ChatGPTMake the book look like an earlier version again (undo). This makes a new version, so nothing is lost: the version before the restore can be restored too. Every version is kept: restore_version brings the old one back. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
set_book
ChatGPTChange the book's title, its notes (your plan: manuscript, style, characters) or its paper colour. Replaces the old value. Every version is kept: restore_version brings the old one back. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
set_page
ChatGPTGive a page or the cover its own paper colour (null = follow the book colour again) and set your note for it (e.g. its manuscript text and picture plan). Replaces the old value. Every version is kept: restore_version brings the old one back. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
show_book
ChatGPTOpen the book in the chat as an interactive widget (pages, print status and an Order button). Call it once after create_book so the user can watch; it refreshes itself when you edit. Other clients get the view link.
update_layers
ChatGPTChange existing layers: the words, position, size, font, colours, crop, mask and more. 1-100 changes in one call. Only the fields in set change; they replace the old values. Every version is kept: restore_version brings the old one back. Send baseVersion = the version you last saw. Returns the new version and the print issues on the pages it touched.
update_order
ChatGPTSet or change quantity, email, shippingAddress (returns live shippingOptions with prices) or shippingLevel on an unpaid order. When nothing is missing, the order gets a checkoutUrl for the user to pay. When the order has bookChange, printVersion records the user's choice of version. Same input twice gives the same order.
view_book
ChatGPTRead-only: the book behind a view link (/b/<shareToken>), with every surface's layers, print issues and printReady. Needs only the shareToken, never the bookId. No notes, no editing: nothing can change a book through its view link. Asked to edit a book from a link: say so, and offer to make a new book (or list_books for the user's own).