Migrate from Classic to Gamma 5
Move a Classic text-to-PPTX integration to Gamma 5 agent generation, with a before/after example and a prompt for your coding agent.
Classic generation (POST /v1.0/generations) keeps working, so nothing breaks if you stay on it. Gamma 5 (POST /v1.0/agent/generations) is the recommended path: you describe the outcome and the Gamma agent plans, writes, and designs the gamma. This page uses a text-to-PPTX integration as the worked example; the same changes apply to other Classic integrations, including PDF or PNG exports and calls with no export. It also lists what to check before you switch traffic.
Quick reference
Create with
POST /v1.0/agent/generationsand sendpromptinstead ofinputText. Unknown fields such astextModeortextOptionsare rejected with400, so remove them.Poll
GET /v1.0/agent/generations/{generationId}(ids start withgen_). The gamma's id and URL move undergamma:gamma.gammaIdandgamma.gammaUrl.Tone, audience, and language become written instructions in
promptoradditionalInstructions. Image, card layout, and header/footer controls have no direct equivalent.numCardsis a soft target. Branding needs an explicitthemeIdortemplateId; there is no workspace default theme.exportAs: "pptx"still works. Acompletedgeneration can still be missing its file: check thatexportUrlexists and handle theexport_failedwarning.Classic
from-templatecalls move totemplateIdon the same endpoint; see Migratefrom-templatecalls.Agent jobs are priced by the work the agent does. Read
credits.deductedfrom the completed or failed response.
What changes
Create
POST /v1.0/generations
POST /v1.0/agent/generations
Content
inputText + textMode
prompt (the brief and any source text)
Style and audience
textOptions.tone, .audience, .language, .amount
Instructions in prompt or additionalInstructions
Poll
GET /v1.0/generations/{id}
GET /v1.0/agent/generations/{generationId}
Result
Top-level gammaId, gammaUrl, exportUrl
gamma.gammaId, gamma.gammaUrl, exportUrl, result.summary, warnings
Pricing
Per card and per image
By the work the agent does
Both endpoints use the same API key in the X-API-KEY header, the same exportAs values (pdf, pptx, png), and the same credit balance. themeId, folderId, and sharingOptions carry over with the same meaning. For the full comparison, see Explore the API.
Before and after: text to PPTX
This is an example. For PDF or PNG (a ZIP of PNGs), change exportAs everywhere it appears and the download file name; with no export, drop exportAs and stop at gamma.gammaUrl, skipping the export fallback and download. Both versions turn the same source text into a branded 10-slide deck for the same audience, poll until the job finishes, and download the PPTX. They read GAMMA_API_KEY and GAMMA_THEME_ID (an id from GET /themes) from the environment.
Request mapping
The same request in each API, so you can map fields one to one:
Complete integration in Python
The full flow, including polling, failure handling, and the download:
What changed in the code:
Request:
inputTextandtextModebecame apromptthat states the job ("condense", "keep every figure") and carries the source text.textOptionsbecame plain-languageadditionalInstructions.Polling: the status path moved under
/agent/, and the loop has a deadline. Agent jobs usually finish in minutes but can run for up to 20, so keep polling past a few minutes and don't resubmit a job that is stillpending.Result: the gamma's id and URL are under
gamma,failedcarrieserror.reason, and the code re-exports whenexportUrlis missing.
Treat exportUrl as a secret: anyone with the link can download the file until it expires (about one week). Don't log it.
Behavior differences
Settings that become instructions
The agent treats prompt and additionalInstructions as guidance and does not validate the output against them. Write each Classic setting as a sentence:
textMode: "generate" / "condense"
Say it in prompt: "develop this outline" or "condense this report to the key points". For "preserve", see Text generation and preservation.
textOptions.tone, .audience
A sentence in additionalInstructions, such as "Audience: new hires. Tone: friendly."
textOptions.language
"Write in Japanese." in additionalInstructions
textOptions.amount
"Keep text per slide brief" (or detailed) in additionalInstructions
title
Ask for the title in prompt; there is no title field.
folderIds
folderId (a single folder id)
Text generation and preservation
Gamma 5 REST generation has no textMode field. Describe in prompt or additionalInstructions whether Gamma should develop an outline, summarize source material, or retain supplied wording.
Develop a topic or outline
Let Gamma write and structure the content.
Turn a report into a shorter presentation
Pass the original report and the summary goal. Don't have your code or the host rewrite it into slides first.
Present finished wording unchanged
Explicitly request preservation and supply the exact text. Verify the finished output.
Preserve only certain passages
Identify those passages separately and state what Gamma may change elsewhere.
Preserving wording is prompt-directed and isn't automatically validated (see content and placeholders). If your workflow depends on exact text, such as textMode: "preserve" today, keep the Classic implementation until you've tested Gamma 5 output against representative inputs.
For approved passages, include the exact text and explicitly prohibit rewriting, shortening, or expanding it. Compare the completed output with the source before distributing it.
Controls without a direct equivalent
imageOptions(source,model,style): the agent chooses image sources and models. Describe the image style you want inadditionalInstructions; you can't pin a model or turn off a source from the request.cardOptions.dimensionsandcardOptions.headerFooter: no request field. Use atemplateIdwhose layout already has the dimensions, logo, or footer you need.cardSplit: "inputTextBreaks": no field. If each section must be its own slide, say so inprompt, and check the slide boundaries in the output.format: "webpage"and multi-pagepages: not supported on Gamma 5. Keep those integrations onPOST /generations.
Slide count and branding
numCardsis a soft target. The agent may land a card or two off, and the result is not validated against it. It is still capped by your plan's card limit; a higher value returns400.On Classic, omitting
themeIdapplies the workspace default theme. Gamma 5 has no default: withoutthemeIdortemplateIdthe agent picks a look. PassthemeIdfor your theme, ortemplateIdto start from an approved template. Don't send both; the request fails with400.sharingOptionsandfolderIdwork as before. A setting that a workspace admin restricts is ignored and reported inwarningson the create response, so log those.
What to verify before switching
Run the new integration on a handful of real inputs next to the Classic one and compare:
Content fidelity
Figures, names, and required sections from the source text appear in the deck, and any wording you asked to keep matches the source exactly. Tighten the prompt if the agent condenses or rewrites too much.
Branding
The PPTX uses your theme or template: colors, fonts, and logo.
Slide count
Close to numCards; adjust downstream code that expects an exact count.
Elapsed time
Time from create to completed on your real inputs. Agent jobs can run for up to 20 minutes, so set timeouts and user messaging from what you measure.
Credits
credits.deducted on the completed or failed response. Cost depends on the work the agent does, so the same input can cost different amounts. The value is best-effort: it can be omitted, or grow if a late charge settles after completion, so for a cost comparison also check usage in Settings > Billing across several real inputs.
Export
How often a completed response arrives without exportUrl (an export_failed warning), and that your code re-exports or reports the problem when it does.
quality (lite, standard, max) changes both output and cost; omitting it uses the API default for your plan. See Review access and pricing.
Prompt for your coding agent
Paste this into a coding agent (such as Devin, Claude Code, Codex, or Cursor) running in the repository that holds your Classic integration. Use the copy button on the block.
Migrate from-template calls
If your integration calls POST /v1.0/generations/from-template, move it to POST /v1.0/agent/generations with templateId. Polling, the exportUrl check, and the download step stay the same as in the example above.
Template id: pass the same id as
templateId. Gamma 5 also accepts any gamma in your workspace and official Explore templates (exploreTemplates[].idfromGET /templates/search).How closely to follow it: Classic keeps the template's structure by default. On Gamma 5 the prompt decides, so say it: "Follow this template's structure and style exactly; only replace the content." Rules that must apply on every run belong in the template's instructions and locked slides.
Theme: drop
themeId. Sending it withtemplateIdreturns400, and the template's own look is the brand. To change the look, save a template with that theme.Title: there is no
titlefield; ask for the title inprompt.
See Generate from approved templates for the full template workflow.
Related
Explore the API: Gamma 5 and Classic endpoints side by side
POST /agent/generations: every request field
GET /agent/generations/{generationId}: pending, completed, and failed responses
Review access and pricing: how agent jobs are charged
Last updated
Was this helpful?