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

# Generate a presentation

> Create, review, and export a Cloud presentation through the public v3 API.

Use synchronous generation when the caller can keep the HTTP connection open until the presentation is complete. The response includes the presentation identifier, exported file path, editor path, and credits consumed.

<Note>
  Use [asynchronous generation](/cloud/guides/async-generation) for production jobs that should not depend on one long-running HTTP connection.
</Note>

## Before you begin

Create an API key in your Presenton account and store it in a secret manager. Send it with every request:

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

The Cloud v3 base URL is:

```text theme={null}
https://api.presenton.ai/api/v3
```

## Generate from a prompt

Send a JSON body to `POST /presentation/generate`:

```bash theme={null}
curl --request POST \
  --url https://api.presenton.ai/api/v3/presentation/generate \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "content": "Create a customer-facing product update covering the latest releases, adoption metrics, and next-quarter roadmap",
    "n_slides": 8,
    "language": "English",
    "tone": "professional",
    "verbosity": "concise",
    "standard_template": "neo-modern",
    "theme": "professional-blue",
    "include_title_slide": true,
    "include_table_of_contents": false,
    "export_as": "pptx"
  }'
```

## Choose the input

The generation request supports three useful input patterns:

| Input     | Use it when                                                                         |
| --------- | ----------------------------------------------------------------------------------- |
| `content` | You want Presenton to plan the deck from a prompt or source text                    |
| `files`   | The deck should be grounded in uploaded reports, documents, or spreadsheets         |
| `slides`  | You already have slide-by-slide outline text and optionally want to specify layouts |

For file input, upload the documents first and pass the returned file values in `files`. See [Generate from documents](/cloud/guides/generate-from-documents).

For more control over the story, generate an outline before creating the presentation:

```bash theme={null}
curl --request POST \
  --url https://api.presenton.ai/api/v3/presentation/outlines/generate \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "content": "Quarterly product update for enterprise customers",
    "n_slides": 6,
    "language": "English",
    "tone": "professional",
    "verbosity": "concise",
    "instructions": "End with the three highest-priority roadmap items."
  }'
```

The outline endpoint returns an array of strings. Review or edit those strings, then pass them to `slides`:

```json theme={null}
{
  "slides": [
    {
      "content": "## Quarterly product update\n\n- Purpose and agenda\n- Key outcomes this quarter",
      "layout": null
    },
    {
      "content": "## Adoption highlights\n\n- Active usage increased\n- Enterprise retention remained stable",
      "layout": null
    }
  ],
  "standard_template": "neo-modern",
  "theme": "professional-blue",
  "export_as": "pptx"
}
```

## Configure the result

| Field                | Supported values or behavior                                                               |
| -------------------- | ------------------------------------------------------------------------------------------ |
| `n_slides`           | Requested number of slides when Presenton plans the deck                                   |
| `instructions`       | Additional requirements, priorities, or constraints                                        |
| `tone`               | `default`, `casual`, `professional`, `funny`, `educational`, or `sales_pitch`              |
| `verbosity`          | `concise`, `standard`, or `text-heavy`                                                     |
| `content_generation` | `preserve`, `enhance`, or `condense`                                                       |
| `web_search`         | Enables web research when set to `true`                                                    |
| `image_type`         | `stock` or `ai-generated`                                                                  |
| `standard_template`  | A built-in or custom standard template identifier                                          |
| `smart_design`       | A Smart design identifier; use this instead of a standard template for Smart presentations |
| `theme`              | A built-in theme name or custom theme identifier                                           |
| `export_as`          | `pptx`, `pdf`, or `png`                                                                    |

Use one presentation design mode per request: select a `standard_template` for schema-backed standard layouts or a `smart_design` for Smart composition.

## Handle the response

A successful request returns this shape:

```json theme={null}
{
  "presentation_id": "8f29a2e7-4f26-48d2-9d1d-9b0716909a6d",
  "path": "https://example.com/generated-presentation.pptx",
  "edit_path": "https://presenton.ai/presentation?id=8f29a2e7-4f26-48d2-9d1d-9b0716909a6d",
  "credits_consumed": 8
}
```

* Store `presentation_id` as the stable identifier for later operations.
* Use `path` to retrieve the generated export.
* Send a user to `edit_path` when they should review or refine the deck in Presenton Cloud.
* Record `credits_consumed` for internal usage reporting when needed.

## Export again after editing

If a user edits the presentation after generation, export the current version with `POST /presentation/export`:

```bash theme={null}
curl --request POST \
  --url https://api.presenton.ai/api/v3/presentation/export \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "id": "8f29a2e7-4f26-48d2-9d1d-9b0716909a6d",
    "export_as": "pdf"
  }'
```

## Recommended flow

1. Validate the prompt, slide count, and uploaded files in your application.
2. Generate and review an outline when narrative control matters.
3. Select a standard template or Smart design and an optional theme.
4. Submit the synchronous or asynchronous generation request.
5. Store the returned presentation and task identifiers.
6. Let a user review the result at `edit_path` when the workflow includes approval.
7. Export the reviewed version and verify the downloaded file.

## Handle failures

* Treat every non-2xx response as a failed request and log its response body with secrets removed.
* A `422` response means the payload does not satisfy the request schema; inspect the validation details before retrying.
* Do not retry authentication or validation failures without changing the request.
* Retry transient network or server failures with a bounded backoff and an application-level timeout.
* Never log the `Authorization` header or expose the API key in client-side code.

<CardGroup cols={2}>
  <Card title="Generate asynchronously" icon="clock-rotate-left" href="/cloud/guides/async-generation">
    Queue long-running generation and monitor its task status.
  </Card>

  <Card title="Templates and themes" icon="palette" href="/cloud/guides/templates-and-themes">
    Discover valid design resources and apply them safely.
  </Card>
</CardGroup>
