{
  "openapi": "3.0.1",
  "info": {
    "title": "Universal Book Engineer: AI Publisher & Ghostwriter",
    "description": "Turn ChatGPT/Gemini conversations (or other text), into industry-standard PDFs & EPUBs. Features \"Fractal Expansion\" to write full books from ideas. Specialized layout engines for Novels, Islamic/Scriptural texts, Children's books, and Technical Manuals. Includes DALL-E 3 art integration.",
    "version": "0.1",
    "x-build-id": "7EfyBvatrwmm1bP6A"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/visita~universal-book-engineer-ai-publisher-ghostwriter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-visita-universal-book-engineer-ai-publisher-ghostwriter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/visita~universal-book-engineer-ai-publisher-ghostwriter/runs": {
      "post": {
        "operationId": "runs-sync-visita-universal-book-engineer-ai-publisher-ghostwriter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/visita~universal-book-engineer-ai-publisher-ghostwriter/run-sync": {
      "post": {
        "operationId": "run-sync-visita-universal-book-engineer-ai-publisher-ghostwriter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "sourceLinks": {
            "title": "🔗 Input Sources",
            "type": "array",
            "description": "List of URLs (ChatGPT Shared Links, Google Docs, or Direct Text Files).",
            "items": {
              "type": "string"
            }
          },
          "qualityTier": {
            "title": "⭐ Quality Tier",
            "enum": [
              "economy",
              "standard",
              "premium"
            ],
            "type": "string",
            "description": "Choose AI model quality. Higher tiers use more capable models for better writing quality.",
            "default": "standard"
          },
          "mergeMode": {
            "title": "Merging Strategy",
            "enum": [
              "anthology",
              "chronological"
            ],
            "type": "string",
            "description": "How to combine multiple links.",
            "default": "anthology"
          },
          "targetGenre": {
            "title": "📘 1. Master Structure (The Skeleton)",
            "enum": [
              "novel",
              "religious",
              "philosophy",
              "manual",
              "childrens",
              "documentary"
            ],
            "type": "string",
            "description": "Defines the physical layout logic (Page Size, Margins).",
            "default": "novel"
          },
          "religiousTradition": {
            "title": "☪️ Religious Tradition (If 'Religious' selected)",
            "enum": [
              "general",
              "islamic",
              "christian",
              "vedic",
              "minimalist_spiritual"
            ],
            "type": "string",
            "description": "Applies specific formatting rules (e.g. 'Bismillah' for Islamic, 'Red Letter' for Christian).",
            "default": "general"
          },
          "fictionTone": {
            "title": "🎭 Fiction Sub-Genre (If 'Novel' selected)",
            "enum": [
              "general",
              "mystery",
              "romance",
              "scifi",
              "fantasy"
            ],
            "type": "string",
            "description": "Guides the AI's rewriting style.",
            "default": "general"
          },
          "childrensAgeGroup": {
            "title": "🧸 Children's Age Group (If 'Childrens' selected)",
            "enum": [
              "toddler",
              "picture_book",
              "middle_grade"
            ],
            "type": "string",
            "description": "Adjusts vocabulary complexity and font size.",
            "default": "picture_book"
          },
          "visualTheme": {
            "title": "🎨 2. Visual Aesthetic (The Paint)",
            "enum": [
              "classic",
              "arabesque",
              "gothic",
              "minimalist",
              "antique",
              "midnight"
            ],
            "type": "string",
            "description": "Choose the visual mood. 'Arabesque' is recommended for Islamic texts.",
            "default": "classic"
          },
          "accentColor": {
            "title": "Accent Color (Hex Code)",
            "pattern": "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$",
            "type": "string",
            "description": "Hex code for borders and headers (e.g. #D4AF37).",
            "default": "#D4AF37"
          },
          "transformationMode": {
            "title": "⚙️ Adaptation Mode",
            "enum": [
              "translate",
              "adapt"
            ],
            "type": "string",
            "description": "'Adapt' rewrites the text (Ghostwrite). 'Translate' preserves original structure.",
            "default": "adapt"
          },
          "targetLanguage": {
            "title": "🌍 Target Language",
            "enum": [
              "en",
              "es",
              "fr",
              "de",
              "it",
              "pt",
              "nl",
              "ar",
              "he",
              "ur",
              "fa",
              "ru",
              "zh",
              "ja",
              "ko",
              "hi"
            ],
            "type": "string",
            "description": "Select the language for the generated book.",
            "default": "en"
          },
          "manualTitle": {
            "title": "Title Override",
            "type": "string",
            "description": "Manually set the book title."
          },
          "manualAuthor": {
            "title": "Author Override",
            "type": "string",
            "description": "Manually set the author name."
          },
          "publisherName": {
            "title": "Publisher",
            "type": "string",
            "description": "Publisher name for the copyright page.",
            "default": "AI Publishing"
          },
          "imageFrequency": {
            "title": "🖼️ Image Frequency",
            "enum": [
              "none",
              "cover_only",
              "sparse",
              "moderate",
              "all"
            ],
            "type": "string",
            "description": "Control how often to generate images.",
            "default": "none"
          },
          "bookContent": {
            "title": "Paste Text",
            "type": "string",
            "description": "Directly paste raw text here instead of using links."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}