Draw cover fronts
const url = 'https://digize.com/api/v1/books/example/cover/draw';const options = { method: 'POST', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>' }};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://digize.com/api/v1/books/example/cover/draw \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>'Draws three cover fronts, each a different idea. With OpenAI connected they’re whole designs drawn by GPT Image at the front’s print size on its account, the title, subtitle and author’s name set into each wherever the design places them, and printed as they are. Without it they’re art by Digize’s Flux on the AI meter, with no words (the title and author are set over it at build), which suits the ebook but is too small to print (upload a cover for print). The last round’s fronts that weren’t picked go.
Needs the books:write permission. It can’t be undone.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.
Example
5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69Responses
Section titled “Responses”Done
object
object
GPT Image on the workspace’s OpenAI account, or Digize’s Flux on the AI meter when OpenAI isn’t connected (1,024 px: the ebook only).
A “Change this” round: what it asked for.
Whether its fronts are whole designs with the title, subtitle and author’s name in them, placed by GPT Image; otherwise they’re art the title and author are set over at build.
object
A whole design with the words in it, printed as it is; otherwise the title and author are set over it at build.
A designed front’s words: title · subtitle · author.
Whether it’s big enough for the printed cover; a smaller one does for the ebook.
The designed front picked reads a title, subtitle or author the book doesn’t have any more: change it or draw new fronts.
The introduction’s opening, as a first draft of the back copy.
object
building while the Workflow sets it, then ready or failed.
The spine’s width, in points.
The whole cover (back, spine and front, with bleed), in points.
A build of the cover alone, for the Cover tab’s preview: no interior or EPUB, the spine sized for the last build’s pages or the words’.
object
object
object
object
object
object
object
object
object
object
object
Words meant for the author left on the page: a writer’s marker, or a note about checking facts or publishing.
object
A figure’s caption or words call the author by name in a book told in the first person.
object
The text mentions a part the book doesn’t have, such as a foreword or a chapter past the last.
object
A chart’s or diagram’s smallest words print under 7 pt at its printed size.
object
object
Example
{ "round": { "source": "openai", "fronts": [ { "status": "drawing" } ] }, "chosen": { "source": "openai" }, "preview": { "status": "building", "coverRule": "lulu", "trim": "5x8", "theme": "classic", "warnings": [ { "kind": "sample" } ] }}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}A request with the same Idempotency-Key is still running (conflict).
object
object
object
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}