With the SlidesGPT API, you can create a presentation by sending a request with a prompt. The API will generate slides based on your input.
Request Example
Send a POST
request to:
https://api.slidesgpt.com/v1/presentations/generate
Sample Code (cURL)
curl -X POST "https://api.slidesgpt.com/v1/presentations/generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Introduction to Machine Learning"}'
Sample Code (JavaScript)
async function generatePresentations(prompt) {
const response = await fetch("https://api.slidesgpt.com/v1/presentations/generate", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({ prompt })
})
return response.json();
}
(async () => {
await generatePresentation("Introduction to Machine Learning");
})();
Note: You must include your API key in the Authorization
header. If you don’t have one, follow the steps in the Authentication Guide to get your API key.
Response Example
{
"id": "123",
"embed": "https://api.slidesgpt.com/123/embed",
"download": "https://api.slidesgpt.com/123/download"
}
You can use the embed
link to preview the presentation or download the PowerPoint file.