{
  "openapi": "3.1.0",
  "info": {
    "title": "Web",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://api.slidesgpt.com",
      "description": "SlidesGPT API"
    }
  ],
  "paths": {
    "/v1/presentations/{id}": {
      "get": {
        "operationId": "getPresentation",
        "summary": "Get a presentation",
        "description": "Get a presentation by id",
        "tags": [
          "Presentations"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "The id of the presentation",
            "schema": {
              "type": "string",
              "description": "The id of the presentation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested presentation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Presentation"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "operationId": "deletePresentation",
        "summary": "Delete a presentation",
        "description": "Delete a presentation by id",
        "tags": [
          "Presentations"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "The id of the presentation",
            "schema": {
              "type": "string",
              "description": "The id of the presentation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "404": {
            "description": "Not found"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/presentations/{id}/download": {
      "get": {
        "operationId": "downloadPresentation",
        "summary": "Download a presentation",
        "description": "Downloads a presentation by id",
        "tags": [
          "Presentations"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "The id of the presentation",
            "schema": {
              "type": "string",
              "description": "The id of the presentation"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested presentation as a file",
            "content": {
              "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/presentations/{id}/embed": {
      "get": {
        "operationId": "embedPresentation",
        "summary": "Get embed URL for a presentation",
        "description": "Returns a redirect URL to view the presentation in Microsoft PowerPoint Online viewer, which can be used in an iframe or opened directly",
        "tags": [
          "Presentations"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "description": "The id of the presentation",
            "schema": {
              "type": "string",
              "description": "The id of the presentation"
            }
          }
        ],
        "responses": {
          "307": {
            "description": "Redirect to the embedded presentation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresentationEmbed"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/presentations/generate": {
      "post": {
        "operationId": "generatePresentation",
        "summary": "Generate a presentation",
        "description": "Generates a presentation based on the provided prompt",
        "tags": [
          "Presentations"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneratePresentation"
              },
              "example": {
                "prompt": "Create a 10 slide presentation about the history of the internet",
                "templateId": "abc123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The generated presentation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Presentation"
                },
                "example": {
                  "id": "123",
                  "embed": "https://api.slidesgpt.com/123/embed",
                  "download": "https://api.slidesgpt.com/123/download"
                }
              }
            }
          },
          "400": {
            "description": "Failed to generate presentation"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GeneratePresentation": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "minLength": 5,
            "maxLength": 64000,
            "description": "The prompt to generate the presentation."
          },
          "templateId": {
            "type": "string",
            "description": "The ID of a custom template to use. Get template IDs from GET /v1/templates."
          }
        },
        "required": [
          "prompt"
        ],
        "additionalProperties": false
      },
      "Presentation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The id of the presentation"
          },
          "embed": {
            "type": "string",
            "format": "uri",
            "description": "The url to embed the presentation. A redirect to a Microsoft PowerPoint viewer url."
          },
          "download": {
            "type": "string",
            "format": "uri",
            "description": "The url to download the presentation as PowerPoint."
          }
        },
        "required": [
          "id",
          "embed",
          "download"
        ],
        "additionalProperties": false
      },
      "PresentationEmbed": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "format": "uri",
            "description": "The redirect location to the embedded presentation."
          }
        },
        "required": [
          "location"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": []
}