Skip to content
StudyFetch API

PDF Generator V3

Generate a new PDF presentation using the SVG/PDF v3 pipeline

OpenAPI specification
POST/api/v1/pdf-generator/v3/create

Authentication

x-api-key

Request

curl --globoff --request POST \
  --url 'https://api.example.com/api/v1/pdf-generator/v3/create' \
  --header 'x-api-key: <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "topic": "<topic>"
}'

Replace credential and <field> placeholders with your own values. URL placeholders appear as %3Cfield%3E. Review the example values before sending your request.

Replace https://api.example.com with the API server URL.

Use the sample JSON body as your starting point, and enter values that match the endpoint's schema.

Request body schema or example

{
  "type": "object",
  "properties": {
    "topic": {
      "type": "string",
      "description": "The topic for the PDF presentation"
    },
    "pages": {
      "type": "number",
      "description": "Number of pages to generate. Alias: numberOfSlides.",
      "minimum": 1,
      "maximum": 50
    },
    "numberOfSlides": {
      "type": "number",
      "description": "Number of slides to generate. Kept for compatibility with the existing PDF API.",
      "minimum": 1,
      "maximum": 50
    },
    "locale": {
      "type": "string",
      "description": "Locale or language code (e.g. \"en\", \"es\", \"ko\", \"es-ES\"). When non-English, drives language-aware AI prompts so the generated deck text is produced in the requested language. Note: non-Latin scripts (Hindi, Korean, Chinese, Japanese, Arabic, Hebrew, Thai) require additional font registration in the SVG render pipeline before glyphs render correctly in the final PDF.",
      "example": "en-US"
    },
    "model": {
      "type": "string",
      "description": "Backend AI model key from utils/ai-models.ts",
      "example": "gemini-3-flash-preview"
    },
    "concurrency": {
      "type": "number",
      "description": "Max in-flight slide SVG generations",
      "minimum": 1,
      "maximum": 20
    }
  },
  "required": [
    "topic"
  ]
}

Responses

201PDF v3 presentation generated successfully
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "example": true
    },
    "presentation": {
      "type": "object",
      "properties": {
        "_id": {
          "type": "string",
          "description": "PDF presentation ID"
        },
        "topic": {
          "type": "string",
          "description": "Topic of the generated presentation"
        },
        "numberOfSlides": {
          "type": "number",
          "description": "Number of generated slides/pages"
        },
        "locale": {
          "type": "string",
          "description": "Locale stored with the generated presentation"
        },
        "url": {
          "type": "string",
          "description": "Signed GCS URL for the generated PDF"
        },
        "transcript": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "pageNum": {
                "type": "number",
                "description": "Page number of the slide"
              },
              "descriptionOfPage": {
                "type": "string",
                "description": "Human-readable slide transcript generated from the v3 outline"
              }
            },
            "required": [
              "pageNum",
              "descriptionOfPage"
            ]
          }
        },
        "rawSlides": {
          "type": "object",
          "properties": {
            "generatorVersion": {
              "type": "string",
              "example": "v3"
            },
            "model": {
              "type": "string",
              "example": "gemini-3-flash-preview"
            },
            "outline": {
              "type": "object",
              "description": "Structured outline used to render the SVG slides"
            },
            "svgs": {
              "description": "Raw SVG source for each generated slide",
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "generatorVersion",
            "model",
            "outline",
            "svgs"
          ]
        },
        "organizationId": {
          "type": "string",
          "description": "Organization ID"
        },
        "userId": {
          "type": "string",
          "description": "User ID"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string",
          "description": "Creation timestamp"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string",
          "description": "Update timestamp"
        }
      },
      "required": [
        "_id",
        "topic",
        "numberOfSlides",
        "locale",
        "url",
        "transcript",
        "rawSlides",
        "organizationId",
        "createdAt",
        "updatedAt"
      ]
    }
  },
  "required": [
    "success",
    "presentation"
  ]
}