POST /generations
Generate a presentation, document, website, or social post from text.
Start an asynchronous generation from text. Use this endpoint when Gamma should determine the layout from your input and generation settings.
Creates an asynchronous generation job. Provide either inputText for a single-page File, or a pages array to generate a multi-page File (optionally published as a Gamma site via publish). Returns a generation ID that can be used to poll for status.
API key for authentication
How to interpret the input text
outlinePossible values: Output format for the generated Gamma
presentationPossible values: How to split content across cards
autoPossible values: Export format for automatic export after generation
pdfPossible values: The text content to generate from (topic, outline, or full content)
Quarterly sales report for Q3 2024Custom title for the generated Gamma. If not provided, a title will be automatically generated from the content.
Q3 2024 Sales ReportAdditional instructions for the AI
Focus on year-over-year growth metricsIf true, publishes the generated File as a Gamma site after all
pages succeed. Applies to multi-page (pages) requests.
trueTarget number of cards/slides to generate
10Theme ID to apply (from /themes endpoint)
theme_abc123Folder to place the generated Gamma in. Accepts at most 1 folder ID.
["folder_abc"]Generation job created successfully
Unique identifier for the generation job
abc123xyzFile-level warnings about the request (e.g., ignored sharing, folder, or dimension options that apply to the whole gamma).
Image model ignored when source is webPage-level warnings, one entry per requested page (index-aligned
with the pages request array); null for a page with none. Each
entry contains only that page's warnings.
Invalid request parameters
Invalid or missing API key
Insufficient credits
Access denied or feature not available
POST /v1.0/generations HTTP/1.1
Host: public-api.gamma.app
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 1565
{
"textMode": "outline",
"pages": [
{
"inputText": "Overview",
"numCards": 5
},
{
"inputText": "Pricing",
"numCards": 3
}
],
"format": "presentation",
"cardSplit": "auto",
"exportAs": "pdf",
"inputText": "Quarterly sales report for Q3 2024",
"title": "Q3 2024 Sales Report",
"additionalInstructions": "Focus on year-over-year growth metrics",
"publish": true,
"numCards": 10,
"themeId": "theme_abc123",
"textOptions": {
"amount": "auto",
"language": "en",
"tone": "professional",
"audience": "marketing executives"
},
"imageOptions": {
"model": "flux-2-pro",
"source": "aiGenerated",
"style": "photorealistic, professional"
},
"cardOptions": {
"dimensions": "16x9",
"headerFooter": {
"topLeft": {
"type": "text",
"source": "themeLogo",
"src": "https://example.com/logo.png",
"value": "Confidential",
"size": "md"
},
"topCenter": {
"type": "text",
"source": "themeLogo",
"src": "https://example.com/logo.png",
"value": "Confidential",
"size": "md"
},
"topRight": {
"type": "text",
"source": "themeLogo",
"src": "https://example.com/logo.png",
"value": "Confidential",
"size": "md"
},
"bottomLeft": {
"type": "text",
"source": "themeLogo",
"src": "https://example.com/logo.png",
"value": "Confidential",
"size": "md"
},
"bottomCenter": {
"type": "text",
"source": "themeLogo",
"src": "https://example.com/logo.png",
"value": "Confidential",
"size": "md"
},
"bottomRight": {
"type": "text",
"source": "themeLogo",
"src": "https://example.com/logo.png",
"value": "Confidential",
"size": "md"
},
"hideFromFirstCard": true,
"hideFromLastCard": false
}
},
"sharingOptions": {
"workspaceAccess": "view",
"externalAccess": "none",
"emailOptions": {
"access": "view",
"recipients": [
"user@example.com"
]
}
},
"folderIds": [
"folder_abc"
]
}{
"generationId": "abc123xyz",
"warnings": "Image model ignored when source is web",
"pageWarnings": [
"text"
]
}Inspecting rate limit headers
Every response from the Gamma API includes rate limit headers (x-ratelimit-remaining-burst, x-ratelimit-remaining, x-ratelimit-remaining-daily). When testing with curl, add the -i flag to display these headers alongside the response body:
Without -i, curl only shows the JSON body. In Python, JavaScript, or any HTTP client, these headers are accessible on the response object without any special flag.
See Rate limit headers and adaptive polling for how to use these headers to pace polling.
Related
Generate from text for parameter-by-parameter guidance
GET /generations/{id} for the polling step after creation
Async patterns and polling for the full polling workflow and rate limit guidance
Last updated
Was this helpful?