### Get Me 200 Response Source: https://docs.slidespeak.co/v2/reference/get-me Example 200 response from the Get Me endpoint, showing the user name and API credit balances. ```json { "user_name": "john_doe", "api_credits": 1000, "additional_api_credits": 200 } ``` -------------------------------- ### Response: Download URL JSON Source: https://docs.slidespeak.co/v2/reference/download Example response showing the JSON object containing the temporary download URL. ```json { "url": "https://slidespeak-files.s3.amazonaws.com/..." } ``` -------------------------------- ### Get Me with PHP Guzzle Source: https://docs.slidespeak.co/v2/reference/get-me Use PHP with GuzzleHttp to call the Get Me endpoint. Requires Guzzle installed via Composer. Replace YOUR_API_KEY with your actual API key. The response is decoded and printed. ```php get('https://api.slidespeak.co/api/v2/me', [ 'headers' => [ 'Content-Type' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY' ] ]); $body = $response->getBody(); $data = json_decode($body, true); print_r($data); ``` -------------------------------- ### Get Me with JavaScript fetch Source: https://docs.slidespeak.co/v2/reference/get-me Use JavaScript fetch to call the Get Me endpoint. Replace YOUR_API_KEY with your actual API key. The response is logged to the console. ```javascript fetch('https://api.slidespeak.co/api/v2/me', { method: 'GET', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'YOUR_API_KEY' } }) .then(response => response.json()) .then(data => { console.log('Me:', data); }) .catch(error => { console.error('Error:', error); }); ``` -------------------------------- ### 200 Response: design kits JSON Source: https://docs.slidespeak.co/v2/reference/design-kits Example successful response. Contains an array of design kits with id, name, and preview_urls fields. Some kits may have empty preview_urls. ```json { "design_kits": [ { "id": "dk_acme", "name": "Acme Brand", "preview_urls": [ "https://slidespeak-design-kit-assets.s3.amazonaws.com/dk_acme/thumbnails/cover.webp" ] }, { "id": "dk_investor_modern", "name": "Modern Investor", "preview_urls": [] } ] } ``` -------------------------------- ### Generate presentation with Python requests Source: https://docs.slidespeak.co/v2/reference/generate Use this Python example with the requests library to generate a presentation. Replace YOUR_API_KEY with your actual API key. The response JSON contains a task_id that is printed. ```python import requests url = "https://api.slidespeak.co/api/v2/presentation/generate" headers = { "Content-Type": "application/json", "X-API-Key": "YOUR_API_KEY", } payload = { "prompt": "Create a concise sales enablement deck for a new CRM integration.", "document_ids": ["doc_123"], "settings": { "design_kit_id": "dk_acme", "length": 8, "language": "ENGLISH", "tone": "professional", "verbosity": "standard", "add_speaker_notes": True, }, } response = requests.post(url, headers=headers, json=payload) print(response.json()["task_id"]) ``` -------------------------------- ### Get Me with Python requests Source: https://docs.slidespeak.co/v2/reference/get-me Use Python requests to call the Get Me endpoint. Replace YOUR_API_KEY with your actual API key. The response is printed as JSON. ```python import requests url = "https://api.slidespeak.co/api/v2/me" headers = { "Content-Type": "application/json", "X-API-Key": "YOUR_API_KEY" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### 201 Response: Webhook Subscription Created Source: https://docs.slidespeak.co/v2/reference/webhooks/create-webhook Example response body returned when the subscription is successfully created, containing the webhook_id. ```json { "webhook_id": "353509d6-8efe-401c-a8a9-53ca64b520a3" } ``` -------------------------------- ### Task creation success response Source: https://docs.slidespeak.co/v2/reference/generate Example response for a successful task creation, returning the task_id to poll for status. ```json { "task_id": "7f9801d8-c8bf-45c3-9fe7-d024b5a76f69" } ``` -------------------------------- ### GET /presentation/design-kits Source: https://docs.slidespeak.co/v2/reference List available design kits. ```APIDOC ## GET /presentation/design-kits ### Description List available design kits. ### Method GET ### Endpoint https://api.slidespeak.co/api/v2/presentation/design-kits ### Authentication Requires `X-API-Key` header. ``` -------------------------------- ### POST /api/v2/presentation/generate Source: https://docs.slidespeak.co/v2/reference/generate Code examples for the presentation generation endpoint in cURL, JavaScript, Python, and PHP. ```APIDOC ## POST /api/v2/presentation/generate ### Description Generates a presentation based on a prompt and optional document IDs, with configurable settings for design, length, language, tone, verbosity, and speaker notes. Returns a task ID for asynchronous processing. ### Method POST ### Endpoint https://api.slidespeak.co/api/v2/presentation/generate ### Parameters #### Request Body - **prompt** (string) - Required - The text prompt describing the presentation to generate. - **document_ids** (array of strings) - Optional - List of document IDs to use as source material. - **settings** (object) - Optional - Configuration object with the following fields: - **design_kit_id** (string) - Optional - Identifier of the design kit to apply. - **length** (integer) - Optional - Desired number of slides. - **language** (string) - Optional - Language for the presentation (e.g., ENGLISH). - **tone** (string) - Optional - Tone of the presentation (e.g., professional). - **verbosity** (string) - Optional - Level of detail (e.g., standard). - **add_speaker_notes** (boolean) - Optional - Whether to include speaker notes. ### Request Example { "prompt": "Create a concise sales enablement deck for a new CRM integration.", "document_ids": ["doc_123"], "settings": { "design_kit_id": "dk_acme", "length": 8, "language": "ENGLISH", "tone": "professional", "verbosity": "standard", "add_speaker_notes": true } } ### Response #### Success Response (200) - **task_id** (string) - Identifier for the asynchronous generation task. #### Response Example { "task_id": "string" } ``` -------------------------------- ### PHP: Download URL with Guzzle Source: https://docs.slidespeak.co/v2/reference/download Use this PHP script with GuzzleHttp\Client to send a GET request with the X-API-Key header and echo the url field from the decoded JSON response. Requires Guzzle installed via Composer. ```php get('https://api.slidespeak.co/api/v2/presentation/download/cmqf2lohi00017wlp3du979zt', [ 'headers' => [ 'X-API-Key' => 'YOUR_API_KEY' ] ]); $data = json_decode($response->getBody(), true); echo $data['url']; ``` -------------------------------- ### Example Request Body Source: https://docs.slidespeak.co/v2/reference/translate JSON body for the translate presentation request. Contains the presentation_id and the target language (e.g., SPANISH). ```json { "presentation_id": "cmgt32cut0000h3ovex8dbzmn", "language": "SPANISH" } ``` -------------------------------- ### cURL: List design kits Source: https://docs.slidespeak.co/v2/reference/design-kits Performs a GET request to the design-kits endpoint with the X-API-Key header. Replace YOUR_API_KEY with your actual API key. ```bash curl -X GET "https://api.slidespeak.co/api/v2/presentation/design-kits" -H "X-API-Key: YOUR_API_KEY" ``` -------------------------------- ### Get Me with cURL Source: https://docs.slidespeak.co/v2/reference/get-me Use cURL to retrieve user details associated with the provided API key. Replace YOUR_API_KEY with your actual API key. ```bash curl -X GET "https://api.slidespeak.co/api/v2/me" -H "Content-Type: application/json" -H "X-API-Key: YOUR_API_KEY" ``` -------------------------------- ### Python: Get download URL with requests Source: https://docs.slidespeak.co/v2/reference/download Use this Python script to send a GET request with the X-API-Key header and print the url field from the JSON response. Requires the requests library. ```python import requests url = "https://api.slidespeak.co/api/v2/presentation/download/cmqf2lohi00017wlp3du979zt" headers = {"X-API-Key": "YOUR_API_KEY"} response = requests.get(url, headers=headers) print(response.json()["url"]) ``` -------------------------------- ### GET /presentation/download/{request_id} Source: https://docs.slidespeak.co/v2/reference Get a short-lived PowerPoint download URL. ```APIDOC ## GET /presentation/download/{request_id} ### Description Get a short-lived PowerPoint download URL. ### Method GET ### Endpoint https://api.slidespeak.co/api/v2/presentation/download/{request_id} ### Path Parameters - **request_id** (string) - Required - The request identifier. ### Authentication Requires `X-API-Key` header. ``` -------------------------------- ### Generate presentation with JavaScript fetch Source: https://docs.slidespeak.co/v2/reference/generate Use this JavaScript example to generate a presentation using the fetch API. Replace YOUR_API_KEY with your actual API key. The response JSON contains a task_id that is logged to the console. ```javascript const response = await fetch('https://api.slidespeak.co/api/v2/presentation/generate', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, body: JSON.stringify({ prompt: 'Create a concise sales enablement deck for a new CRM integration.', document_ids: ['doc_123'], settings: { design_kit_id: 'dk_acme', length: 8, language: 'ENGLISH', tone: 'professional', verbosity: 'standard', add_speaker_notes: true } }), }); const data = await response.json(); console.log(data.task_id); ``` -------------------------------- ### Generate presentation with PHP Guzzle Source: https://docs.slidespeak.co/v2/reference/generate Use this PHP example with GuzzleHttp to generate a presentation. Replace YOUR_API_KEY with your actual API key. The response body is decoded and the task_id is echoed. ```php post('https://api.slidespeak.co/api/v2/presentation/generate', [ 'headers' => [ 'Content-Type' => 'application/json', 'X-API-Key' => 'YOUR_API_KEY' ], 'json' => [ 'prompt' => 'Create a concise sales enablement deck for a new CRM integration.', 'document_ids' => ['doc_123'], 'settings' => [ 'design_kit_id' => 'dk_acme', 'length' => 8, 'language' => 'ENGLISH', 'tone' => 'professional', 'verbosity' => 'standard', 'add_speaker_notes' => true ] ] ]); $data = json_decode($response->getBody(), true); echo $data['task_id']; ``` -------------------------------- ### Async Task Failure Response Example Source: https://docs.slidespeak.co/v2/reference/errors Example response from polling `/task_status/{task_id}` for a failed async task. When `task_status` is `FAILURE`, use `task_error` for error handling; `task_result` and `task_info` may be null. ```json { "task_id": "9649d202-03ac-437a-80e8-ff91ff4ace67", "task_status": "FAILURE", "task_result": null, "task_info": null, "task_error": { "code": "EXPORT_FAILED", "status_code": 500, "retryable": true, "message": "The presentation export failed.", "details": {}, "request_id": "cmqf2lohi00017wlp3du979zt" } } ``` -------------------------------- ### Response: SENT Source: https://docs.slidespeak.co/v2/reference/get-task-status Example response when the task status is SENT. The task_result and task_info fields are null. ```json { "task_id": "9649d202-03ac-437a-80e8-ff91ff4ace67", "task_status": "SENT", "task_result": null, "task_info": null } ``` -------------------------------- ### Create video request body Source: https://docs.slidespeak.co/v2/reference/video Example request body for creating a video generation task. Specifies the presentation ID, language, voice, captions, quality, and speed. ```json { "presentation_id": "cmgt32cut0000h3ovex8dbzmn", "language": "ENGLISH", "voice_id": "en-US-AvaMultilingualNeural", "captions": true, "quality": "hd", "speed": 1.0 } ``` -------------------------------- ### Response: SUCCESS Source: https://docs.slidespeak.co/v2/reference/get-task-status Example response when the task status is SUCCESS. The task_result and task_info fields contain task-specific data. ```json { "task_id": "351ceb47-1377-4641-a5ff-420816a84ba9", "task_status": "SUCCESS", "task_result": "", "task_info": "" } ``` -------------------------------- ### GET /api/v2/presentation/voices Source: https://docs.slidespeak.co/v2/reference/voices Lists the narration voices available for a language. Use a returned voice_id with /presentation/video to pick the voice your video is narrated with. ```APIDOC ## GET /api/v2/presentation/voices ### Description Lists the narration voices available for a language. Use a returned `voice_id` with `/presentation/video` to pick the voice your video is narrated with. ### Method GET ### Endpoint https://api.slidespeak.co/api/v2/presentation/voices ### Parameters #### Headers - **X-API-Key** (string) - Required - The API key to use for the request. #### Query Parameters - **language** (string) - Optional - The language to list voices for. Pass a language code such as `ENGLISH`, `ENGLISH_UK` or `SPANISH_MEXICO` — matching is case-insensitive. Unsupported values are rejected with a 400 that lists the accepted codes. See Supported Languages. ### Request Example ``` curl -X GET "https://api.slidespeak.co/api/v2/presentation/voices?language=ENGLISH_UK" -H "X-API-Key: YOUR_API_KEY" ``` ### Response #### Success Response (200) - **voices** (array) - The list of available voices. Each voice contains a `voice_id` and other details. #### Response Example ``` { "voices": [ { "voice_id": "string", "name": "string", "language": "string" } ] } ``` ### Error Handling - **400 Bad Request** - Returned when an unsupported language value is provided. The response lists the accepted language codes. ``` -------------------------------- ### Python: Translate presentation with requests Source: https://docs.slidespeak.co/v2/reference/translate Sends a POST request using the requests library and prints the task_id from the JSON response. Requires the requests package to be installed. ```Python import requests url = "https://api.slidespeak.co/api/v2/presentation/translate" headers = { "Content-Type": "application/json", "X-API-Key": "YOUR_API_KEY", } payload = { "presentation_id": "cmgt32cut0000h3ovex8dbzmn", "language": "SPANISH", } response = requests.post(url, headers=headers, json=payload) print(response.json()["task_id"]) ``` -------------------------------- ### PHP: Guzzle client list design kits Source: https://docs.slidespeak.co/v2/reference/design-kits Uses GuzzleHttp\Client to send a GET request with the API key header. Decodes the JSON body and prints the design_kits array. ```php get('https://api.slidespeak.co/api/v2/presentation/design-kits', [ 'headers' => [ 'X-API-Key' => 'YOUR_API_KEY' ] ]); $data = json_decode($response->getBody(), true); print_r($data['design_kits']); ``` -------------------------------- ### Python: Get Task Status Source: https://docs.slidespeak.co/v2/reference/get-task-status Use this Python requests example to get the task status. It sends a GET request with the X-API-Key header and prints the JSON response. ```python import requests url = "https://api.slidespeak.co/api/v2/task_status/7f9801d8-c8bf-45c3-9fe7-d024b5a76f69" headers = {"X-API-Key": "YOUR_API_KEY"} response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### JavaScript: Get Task Status Source: https://docs.slidespeak.co/v2/reference/get-task-status Use this JavaScript fetch example to get the task status. It sends a GET request with the X-API-Key header and logs the JSON response. ```javascript const response = await fetch('https://api.slidespeak.co/api/v2/task_status/7f9801d8-c8bf-45c3-9fe7-d024b5a76f69', { method: 'GET', headers: { 'X-API-Key': 'YOUR_API_KEY' } }); const data = await response.json(); console.log(data); ``` -------------------------------- ### POST /presentation/import Source: https://docs.slidespeak.co/v2/reference Import an existing PowerPoint file as a presentation. ```APIDOC ## POST /presentation/import ### Description Import an existing PowerPoint file as a presentation. ### Method POST ### Endpoint https://api.slidespeak.co/api/v2/presentation/import ### Authentication Requires `X-API-Key` header. ``` -------------------------------- ### PHP: Get Task Status Source: https://docs.slidespeak.co/v2/reference/get-task-status Use this PHP Guzzle example to get the task status. It sends a GET request with the X-API-Key header and prints the decoded JSON response. ```php get('https://api.slidespeak.co/api/v2/task_status/7f9801d8-c8bf-45c3-9fe7-d024b5a76f69', [ 'headers' => [ 'X-API-Key' => 'YOUR_API_KEY' ] ]); $data = json_decode($response->getBody(), true); print_r($data); ``` -------------------------------- ### cURL: Download presentation with X-API-Key Source: https://docs.slidespeak.co/v2/reference/download Use this cURL command to request a temporary download URL. Replace YOUR_API_KEY with your actual API key and the request_id in the URL with the one from the task status response. ```bash curl -X GET "https://api.slidespeak.co/api/v2/presentation/download/cmqf2lohi00017wlp3du979zt" -H "X-API-Key: YOUR_API_KEY" ``` -------------------------------- ### 200 response for GET reusable-sections Source: https://docs.slidespeak.co/v2/reference/reusable-sections Example 200 response for the GET reusable-sections endpoint. Shows the structure of reusable_sections array with id, name, placement, slide_count, and updated_at fields. ```json { "reusable_sections": [ { "id": "rs_overview", "name": "Company overview", "placement": "beginning", "slide_count": 3, "updated_at": "2026-06-23T10:00:00+00:00" }, { "id": "rs_security_appendix", "name": "Security & compliance appendix", "placement": "end", "slide_count": 4, "updated_at": "2026-06-20T08:30:00+00:00" } ] } ``` -------------------------------- ### Create presentation generation request Source: https://docs.slidespeak.co/v2/reference/generate Example request body for creating a presentation generation task. Includes prompt, document IDs, and settings such as design kit, length, language, tone, verbosity, and speaker notes. ```json { "prompt": "Create a concise sales enablement deck for a new CRM integration.", "document_ids": ["doc_123"], "settings": { "design_kit_id": "dk_acme", "length": 8, "language": "ENGLISH", "tone": "professional", "verbosity": "standard", "add_speaker_notes": true } } ``` -------------------------------- ### GET reusable-sections: cURL, JavaScript, Python, PHP examples Source: https://docs.slidespeak.co/v2/reference/reusable-sections Call the GET /presentation/reusable-sections endpoint with the X-API-Key header to retrieve reusable sections. The response contains an array of reusable_sections, each with an id to pass as settings.reusable_section_id. ```bash curl -X GET "https://api.slidespeak.co/api/v2/presentation/reusable-sections" -H "X-API-Key: YOUR_API_KEY" ``` ```javascript const response = await fetch('https://api.slidespeak.co/api/v2/presentation/reusable-sections', { method: 'GET', headers: { 'X-API-Key': 'YOUR_API_KEY' } }); const data = await response.json(); console.log(data.reusable_sections); ``` ```python import requests url = "https://api.slidespeak.co/api/v2/presentation/reusable-sections" headers = {"X-API-Key": "YOUR_API_KEY"} response = requests.get(url, headers=headers) print(response.json()["reusable_sections"]) ``` ```php get('https://api.slidespeak.co/api/v2/presentation/reusable-sections', [ 'headers' => [ 'X-API-Key' => 'YOUR_API_KEY' ] ]); $data = json_decode($response->getBody(), true); print_r($data['reusable_sections']); ``` -------------------------------- ### POST /presentation/video Source: https://docs.slidespeak.co/v2/reference Turn an existing presentation into a narrated video. ```APIDOC ## POST /presentation/video ### Description Turn an existing presentation into a narrated video. ### Method POST ### Endpoint https://api.slidespeak.co/api/v2/presentation/video ### Authentication Requires `X-API-Key` header. ``` -------------------------------- ### cURL: Get Task Status Source: https://docs.slidespeak.co/v2/reference/get-task-status Use this cURL command to retrieve the status of a task. Replace YOUR_API_KEY with your actual API key and the task_id in the URL with the ID obtained after starting a task. ```bash curl -X GET "https://api.slidespeak.co/api/v2/task_status/7f9801d8-c8bf-45c3-9fe7-d024b5a76f69" -H "X-API-Key: YOUR_API_KEY" ``` -------------------------------- ### POST /presentation/generate Source: https://docs.slidespeak.co/v2/reference Generate a presentation from a prompt and optional documents. ```APIDOC ## POST /presentation/generate ### Description Generate a presentation from a prompt and optional documents. ### Method POST ### Endpoint https://api.slidespeak.co/api/v2/presentation/generate ### Authentication Requires `X-API-Key` header. ``` -------------------------------- ### Generate a presentation with curl Source: https://docs.slidespeak.co/v2/quickstart Creates a presentation by sending a POST request to the v2 generation endpoint. Requires a valid API key in the X-API-Key header. The response contains a task_id used to track the generation process. ```bash curl -L \ -X POST \ -H 'Content-Type: application/json' \ -H 'X-API-Key: YOUR_API_KEY' \ 'https://api.slidespeak.co/api/v2/presentation/generate' \ -d '{"prompt":"Key moments in the french revolution", "settings": {"length": 6}}' ``` -------------------------------- ### Import a .pptx file via POST /api/v2/presentation/import Source: https://docs.slidespeak.co/v2/reference/import Uploads a .pptx file to the SlideSpeak v2 import endpoint and prints the returned presentation_id. Requires an API key set in the X-API-Key header; the file must be at most 100 MB. The response is synchronous, so the ID is ready for later translation calls. ```bash curl -X POST "https://api.slidespeak.co/api/v2/presentation/import" -H "X-API-Key: YOUR_API_KEY" -F "file=@presentation.pptx" ``` ```javascript import { readFile } from 'node:fs/promises'; const form = new FormData(); form.append('file', new Blob([await readFile('presentation.pptx')]), 'presentation.pptx'); const response = await fetch('https://api.slidespeak.co/api/v2/presentation/import', { method: 'POST', headers: { 'X-API-Key': 'YOUR_API_KEY' }, body: form, }); const data = await response.json(); console.log(data.presentation_id); ``` ```python import requests url = "https://api.slidespeak.co/api/v2/presentation/import" headers = {"X-API-Key": "YOUR_API_KEY"} with open("presentation.pptx", "rb") as f: response = requests.post(url, headers=headers, files={"file": ("presentation.pptx", f)}) print(response.json()["presentation_id"]) ``` ```php post('https://api.slidespeak.co/api/v2/presentation/import', [ 'headers' => [ 'X-API-Key' => 'YOUR_API_KEY' ], 'multipart' => [ [ 'name' => 'file', 'contents' => fopen('presentation.pptx', 'r'), 'filename' => 'presentation.pptx' ] ] ]); $data = json_decode($response->getBody(), true); echo $data['presentation_id']; ``` -------------------------------- ### Download the presentation as a PowerPoint file Source: https://docs.slidespeak.co/v2/examples/generate-presentation-from-pdf Exchanges a request_id for a short-lived download URL via the /presentation/download/{requestId} endpoint, then fetches that URL, creates a blob, and triggers a browser download with the specified filename (default 'presentation.pptx'). ```javascript async function downloadPresentation(requestId, filename = 'presentation.pptx') { const res = await fetch(`${API_BASE}/presentation/download/${requestId}`, { headers: { 'X-API-Key': API_KEY } }); const { url } = await res.json(); const fileResponse = await fetch(url); const blob = await fileResponse.blob(); const objectUrl = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = objectUrl; a.download = filename; document.body.appendChild(a); a.click(); a.remove(); window.URL.revokeObjectURL(objectUrl); } ``` -------------------------------- ### HTTP Error Response Example Source: https://docs.slidespeak.co/v2/reference/errors Example HTTP error response body for a non-2xx response. Use the `error` object for programmatic error handling; `detail` is descriptive only. ```json { "detail": "Design kit is not available to this user", "error": { "code": "DESIGN_KIT_NOT_ACCESSIBLE", "status_code": 403, "retryable": false, "message": "Design kit is not available to this user", "details": {}, "request_id": "cmqf2lohi00017wlp3du979zt" } } ``` -------------------------------- ### GET /task_status/{task_id} Source: https://docs.slidespeak.co/v2/reference Poll a generation or upload task. ```APIDOC ## GET /task_status/{task_id} ### Description Poll a generation or upload task. ### Method GET ### Endpoint https://api.slidespeak.co/api/v2/task_status/{task_id} ### Path Parameters - **task_id** (string) - Required - The task identifier. ### Authentication Requires `X-API-Key` header. ``` -------------------------------- ### GET /presentation/voices Source: https://docs.slidespeak.co/v2/reference List the narration voices available for a language. ```APIDOC ## GET /presentation/voices ### Description List the narration voices available for a language. ### Method GET ### Endpoint https://api.slidespeak.co/api/v2/presentation/voices ### Authentication Requires `X-API-Key` header. ``` -------------------------------- ### Complete PDF to presentation workflow Source: https://docs.slidespeak.co/v2/examples/generate-presentation-from-pdf Complete asynchronous workflow for converting a PDF to a presentation: upload the file, poll for document processing, generate the presentation, poll for generation, then download. Requires an X-API-Key header and consumes credits per slide. ```javascript async function handlePDFUpload(file) { try { // Step 1: Upload const uploadTask = await uploadPDF(file); // Step 2: Poll document processing const uploadResult = await pollTask(uploadTask.task_id); // Step 3: Generate presentation const genTask = await generatePresentation(uploadResult.task_result); // Step 4: Poll presentation generation const presResult = await pollTask(genTask.task_id); // Step 5: Download await downloadPresentation(presResult.request_id); console.log('Download started'); } catch (err) { console.error('Error:', err); } } ``` -------------------------------- ### GET /presentation/download/{request_id} Source: https://docs.slidespeak.co/v2/reference/generate Downloads a generated presentation using the request ID obtained from the task result. ```APIDOC ## GET /presentation/download/{request_id} ### Description Downloads a generated presentation using the request ID obtained from the task result. ### Method GET ### Endpoint /presentation/download/{request_id} ### Parameters #### Path Parameters - **request_id** (string) - Required - The request ID from the task result. ### Response #### Success Response (200) - The presentation file (binary). ``` -------------------------------- ### Create video with Python requests Source: https://docs.slidespeak.co/v2/reference/video Uses the requests library to POST the video creation request. The response JSON is accessed and the task_id is printed. ```python import requests url = "https://api.slidespeak.co/api/v2/presentation/video" headers = { "Content-Type": "application/json", "X-API-Key": "YOUR_API_KEY", } payload = { "presentation_id": "cmgt32cut0000h3ovex8dbzmn", "language": "ENGLISH", "captions": True, "quality": "hd", "speed": 1.0, } response = requests.post(url, headers=headers, json=payload) print(response.json()["task_id"]) ``` -------------------------------- ### Create video with JavaScript fetch Source: https://docs.slidespeak.co/v2/reference/video Uses the Fetch API to create a video from a presentation. The response is parsed as JSON and the task_id is logged to the console. ```javascript const response = await fetch('https://api.slidespeak.co/api/v2/presentation/video', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, body: JSON.stringify({ presentation_id: 'cmgt32cut0000h3ovex8dbzmn', language: 'ENGLISH', captions: true, quality: 'hd', speed: 1.0 }), }); const data = await response.json(); console.log(data.task_id); ``` -------------------------------- ### GET /api/v2/me Source: https://docs.slidespeak.co/v2/reference/get-me Retrieves the user details associated with the provided API key, including the username and API credit balances. ```APIDOC ## GET /api/v2/me ### Description Retrieves the user details associated with the provided API key. Use this endpoint to confirm which user account is linked to the API key being used and the number of API credits remaining. ### Method GET ### Endpoint https://api.slidespeak.co/api/v2/me ### Headers - **Content-Type** (string) - Required - Must be `application/json`. - **X-API-Key** (string) - Required - The API key to use for the request. Example: ``. ### Request Example ``` curl -X GET "https://api.slidespeak.co/api/v2/me" \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" ``` ### Response #### Success Response (200) - **user_name** (string) - The username of the authenticated user. - **api_credits** (number) - The number of API credits remaining. - **additional_api_credits** (number) - Additional API credits available. #### Response Example ``` { "user_name": "john_doe", "api_credits": 1000, "additional_api_credits": 200 } ``` ``` -------------------------------- ### Generate a presentation with the Slidespeak API Source: https://docs.slidespeak.co/v2/examples/generate-presentation-from-pdf Sends a POST request to /presentation/generate with a prompt, document ID, and optional settings such as design_kit_id, length, language, tone, and verbosity. Returns a JSON response containing a task_id for later polling. ```javascript async function generatePresentation(documentId) { const response = await fetch(`${API_BASE}/presentation/generate`, { method: 'POST', headers: { 'X-API-Key': API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'Summarize the attached document into a concise deck.', document_ids: [documentId], settings: { design_kit_id: 'dk_acme', length: 15, language: 'ORIGINAL', tone: 'professional', verbosity: 'concise' } }) }); return response.json(); } ``` ```json { "task_id": "f0db8d6c-6378-4df4-8585-ec3c434b2614" } ```