> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I generate a PowerPoint from a prompt via API?

> Call documents.create with format pptx and a prompt: you get an editable 16:9 .pptx with native charts, plus its PDF.

To generate a PowerPoint from a prompt, call `documents.create` with `format: "pptx"` and the presentation described
in `prompt`. You get an editable 16:9 `.pptx`, with native charts and a theme that any slides you add later follow,
plus its PDF.

## Steps

1. Store your API key in `DOCONDA_API_KEY` and install the SDK (`pip install doconda` or `npm install @doconda/sdk`).
2. Describe the presentation and, if you like, the style.
3. Download the `.pptx`.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  from pathlib import Path
  from doconda import Doconda

  doconda = Doconda()  # reads the key from DOCONDA_API_KEY
  doc = doconda.documents.create(
      format="pptx",
      prompt="Quarterly results for the board",
      style="dark blue headings, Lora font",
      quality="best",
  )
  Path("board.pptx").write_bytes(doconda.documents.download(doc["id"], "pptx"))
  ```

  ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  import { writeFile } from "node:fs/promises"
  import { Doconda } from "@doconda/sdk"

  const doconda = new Doconda()
  const doc = await doconda.documents.create({
    format: "pptx",
    prompt: "Quarterly results for the board",
    style: "dark blue headings, Lora font",
    quality: "best",
  })
  await writeFile("board.pptx", await doconda.documents.download(doc.id, "pptx"))
  ```
</CodeGroup>

If the data is in your files (a sales spreadsheet, a PDF), upload them with `files.upload` and pass them in `sources`:
Doconda reads them before writing.

## What you get back

* A 16:9 `.pptx` with editable text, tables and charts (not images), plus its PDF.
* `status`: `ready`, `ready_with_warnings`, `needs_review` or `failed` (not charged).
* A report (`documents.report(id)`), with warnings such as `content.unsupported_fact` if a figure appears that isn't
  in your request or your sources.
* `quality`: which level was used and why (`requested`, `level`, `reason`).

## Limits

* Charts and copying your template's design need `standard` or `best`. In `fast` you get the basic style.
* Typical time: `standard`, about 3 min median; `best`, about 5-10 min. With `"stream": true` you see the events as it
  is made.
* Your own images: up to 10 in `sources` (PNG, JPEG, GIF or WebP).

## FAQ

<AccordionGroup>
  <Accordion title="Can I use my company's template?">
    Yes. Pass your presentation in `sources` and say "with our template's design": the result starts from its slides.
    Needs `standard` or `best`.
  </Accordion>

  <Accordion title="Can I change it later?">
    Yes, with `operation: "edit"` and the `doc_…` id: add, reorder or remove slides while keeping the design.
  </Accordion>

  <Accordion title="How do I avoid waiting in the same call?">
    Use `createInBackground` (`create_in_background` in Python) and then `wait(id)`, or
    [webhooks](/en/guides/webhooks).
  </Accordion>
</AccordionGroup>

## Keep reading

* [Create](/en/guides/create) and [SDK: create documents](/en/sdk/create).
* [Quickstart](/en/quickstart).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.