Poll for results
Understanding how to work with Gamma’s asynchronous API and poll for results
Gamma generation is asynchronous. You start a generation, receive a generationId immediately, then poll the status endpoint until the result is ready.
Quick reference
POST /v1.0/generationsreturnsgenerationIdonly.Poll
GET /v1.0/generations/{id}every 5 seconds untilstatusiscompletedorfailed.gammaUrlandexportUrlare only available from the completed status response.The examples below use the Classic endpoint. Gamma 5 agent endpoints work differently:
Request: send
promptinstead ofinputText/textMode. Unknown fields are rejected.Polling: poll
GET /v1.0/agent/generations/{generationId}(IDs start withgen_) untilstatusiscompletedorfailed. Thegammaobject can appear while the generation is stillpending, so wait forcompletedbefore treating the result as done. Optionalprogressreportsdone,total, andpercent(0–99; onlycompletedis 100%) plus per-stage counts understagesonce the agent starts building cards.Result: read
gamma.gammaIdandgamma.gammaUrl. Edits are polled atGET /v1.0/agent/edits/{editId}and return top-levelgammaIdandgammaUrl.Too many jobs: a
429with codeworkspace_concurrency_limit_exceededmeans too many in-flight agent jobs, too many pending Classic or image generations on a Free workspace (API key), or HTTP rate limits; wait the seconds in theRetry-Afterheader before retrying.Pace:
pace: "relaxed"lets an agent job run about twice as long; see Choose a pace for agent jobs.For a complete, runnable agent example, see the quickstart. To move a Classic integration, see Migrate from Classic to Gamma 5.
Export URLs expire after approximately one week. Anyone with the URL can download the file; access is not tied to your API key. Treat export links as secrets — do not log them, share them, or embed them in client-side code.
Export format matches
exportAs:pdfandpptxdownload directly;pngreturns a.zipwith one PNG per card.
The basic flow
What you get back
When status is completed, the response includes:
gammaUrl
Direct link to view/share the presentation in Gamma
exportUrl
Download URL for the exported file (if exportAs was specified). png exports are a .zip with one PNG per card. Expires after about one week; treat the URL as a secret.
Generation states
pending
Still generating
Keep polling every 5 seconds
completed
Done!
Stop polling — use gammaUrl and export URLs
failed
Something went wrong
Stop polling, check the error object
Code examples
Using automation platforms
Popular automation platforms have built-in ways to handle delays and polling:
Zapier
Use the Delay action between your HTTP Request steps:
HTTP Request (POST) → Start generation, get
generationIdDelay for → Wait 30-60 seconds
HTTP Request (GET) → Check status with the
generationIdUse Paths or Filter to check if
statusequalscompletedIf still pending, use Looping by Zapier to repeat steps 2-4
Zapier's "Delay for" action pauses your Zap for a specified time (minimum 1 minute). For most Gamma generations, a single 60-second delay followed by a status check works well.
Make (formerly Integromat)
Use the Sleep module or a polling pattern:
HTTP module → POST to start generation
Sleep module → Wait 30 seconds
HTTP module → GET to check status
Router with filter → Check if
statusiscompletedUse Repeater + Sleep for polling loop
n8n
Use the Wait node with time interval:
HTTP Request node → POST to start generation
Wait node → Set to "After Time Interval" (30-60 seconds)
HTTP Request node → GET to check status
IF node → Check
status === "completed"Loop back to Wait node if still pending
n8n's Wait node offloads execution data to the database during longer waits, so your workflow won't timeout even for complex generations.
Best practices
Use 5-second polling intervals. Polling more frequently will not speed up the generation and may increase the chance of rate limiting.
Set a maximum timeout. Most generations complete within 2-3 minutes, so a 5-minute ceiling is a good default for automation.
Handle all three states:
pending,completed, andfailed.Use exponential backoff if you receive a 429 response.
Running multiple generations
You can start multiple generations in parallel. To manage throughput:
Use the
x-ratelimit-remaining-burstheader on each response to pace your requests. See Rate limit headers and adaptive polling below for how to read these headers.Stagger your
POST /generationscalls and poll the resulting IDs round-robin rather than waiting for each generation to complete before starting the next.If responses slow down or you receive a
429, back off and let the rate limit headers guide your pacing.
Starting a generation without waiting
POST /generations returns a generationId immediately — you do not need to wait for the generation to finish inline. To poll later, all you need is your API key and the generationId.
This is useful for workflows that start a generation in one step and check the result in a later step. For example, a multi-step automation can fire off a generation, continue with other work, and come back to poll GET /generations/{id} when it is ready to use the result.
Monitoring credit usage
The credits field (with deducted and remaining) appears on completed and failed poll responses for Classic generations, agent generations, and agent edits. It is not included while the job is still pending.
Check
credits.remainingafter each completed generation before starting another.If credits run out, subsequent
POST /generationscalls return402with"Insufficient credits remaining", and agent endpoints return403with codeinsufficient_credits. Checking the remaining balance proactively avoids unexpected failures mid-workflow.Enable auto-recharge to avoid interruptions.
Choose a pace for agent jobs
POST /agent/generations and POST /agent/gammas/{gammaId}/edits accept an optional pace that sets how long the agent may work. relaxed gives the agent about twice the time for more thinking, review, and finishing passes, so use it for batch jobs that would rather wait for a better gamma.
pace
Generation deadline
Edit deadline
standard (default)
20 minutes
10 minutes
relaxed
40 minutes
20 minutes
Omit
paceforstandard. Any other value, includingnull, returns400.paceandqualityare independent:qualitypicks the models,pacepicks how long the run may take. On plans that includemax,quality: "max"withpace: "relaxed"gives the best output.Status responses don't include
pace, so record it on your side if you need it.Set your client timeout above the deadline, for example 45 minutes for relaxed generations and 25 minutes for relaxed edits.
A job that runs past its deadline ends with
status: "failed"anderror.reasontimeout(statusCode504). A timed-out edit may be partly applied, so check the gamma before retrying.A relaxed job counts against the workspace's in-flight agent job limit for its whole run, so it holds its slot up to twice as long. Over the limit, the API returns
429with codeworkspace_concurrency_limit_exceeded; wait for theRetry-Afterinterval.
Rate limit headers and adaptive polling
Every API response includes headers that show your current rate limit usage. Use these to adjust your polling speed dynamically instead of waiting for a 429 error.
To see these headers in curl, add the -i flag. You can also use -v for full verbose output including request headers and TLS details, but -i is cleaner for inspecting rate limits.
Without -i, you'd only see the JSON body. The headers are always present — -i just tells curl to display them. In Python, JavaScript, or any HTTP client, these headers are always accessible on the response object without any special flag.
x-ratelimit-limit-burst
Maximum requests allowed in the current short window
x-ratelimit-remaining-burst
Requests remaining in the current short window
x-ratelimit-limit
Maximum requests allowed per hour
x-ratelimit-remaining
Requests remaining in the current hour
x-ratelimit-limit-daily
Maximum requests allowed per day
x-ratelimit-remaining-daily
Requests remaining today
Adaptive polling example
Instead of a fixed 5-second interval, read x-ratelimit-remaining-burst and slow down when capacity is low:
Handling a 429 response
If you hit the rate limit, the API returns 429 Too Many Requests. Pause for 30 seconds before retrying, then use exponential backoff if subsequent requests also return 429.
Common issues
status stays pending for too long
Generations typically complete in 1-3 minutes. If you are waiting longer than 5 minutes:
Check that you're polling the correct
generationIdVerify your API key has sufficient credits
Try generating with fewer cards (
numCards) to test
You receive a 429 rate-limit response
If you receive a 429 error:
Use 5+ second polling intervals
Use
curl -ito check thex-ratelimit-remaining-burstheader and see if you're near the limitSee Rate limit headers and adaptive polling above for how to throttle dynamically
If the response includes
code: workspace_concurrency_limit_exceeded, wait forRetry-Afterseconds and finish or poll existing jobs before starting another create requestIf you're using Zapier, Make, or n8n, the rate limit may be on the platform side rather than Gamma's
Related
Error codes for the full list of API errors and troubleshooting guidance
Generate from text for parameter-level guidance on
POST /v1.0/generationsCharts and structured content for prompting charts and infographics
Image URL best practices for including your own images
API Overview for a broader workflow comparison
Last updated
Was this helpful?