For the complete documentation index, see llms.txt. This page is also available as Markdown.

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/generations and send prompt instead of inputText. Unknown fields such as textMode or textOptions are rejected with 400, so remove them.

  • Poll GET /v1.0/agent/generations/{generationId} (ids start with gen_). The gamma's id and URL move under gamma: gamma.gammaId and gamma.gammaUrl.

  • Tone, audience, and language become written instructions in prompt or additionalInstructions. Image, card layout, and header/footer controls have no direct equivalent.

  • numCards is a soft target. Branding needs an explicit themeId or templateId; there is no workspace default theme.

  • exportAs: "pptx" still works. A completed generation can still be missing its file: check that exportUrl exists and handle the export_failed warning.

  • Classic from-template calls move to templateId on the same endpoint; see Migrate from-template calls.

  • Agent jobs are priced by the work the agent does. Read credits.deducted from the completed or failed response.

What changes

Classic
Gamma 5

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: inputText and textMode became a prompt that states the job ("condense", "keep every figure") and carries the source text. textOptions became plain-language additionalInstructions.

  • 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 still pending.

  • Result: the gamma's id and URL are under gamma, failed carries error.reason, and the code re-exports when exportUrl is 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:

Classic setting
Gamma 5 equivalent

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.

What the user wants
Recommended handling

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.

On the MCP server, the interface differs. The MCP generate tool still exposes textMode and cardSplit:

  • Use preserve when the user explicitly asks for unchanged wording or supplies finished slide text. Don't select it just because the host has already written a detailed draft.

  • A pasted report or notes aren't finished slide copy. Pass the original material plus the user's audience, purpose, and instructions.

  • Use cardSplit: "inputTextBreaks" only for intentional slide boundaries, not document dividers or breaks the host invented.

  • Gamma 5 may resolve bracketed internal notes such as [TBD] even with preserve; it isn't literal pass-through.

Controls without a direct equivalent

  • imageOptions (source, model, style): the agent chooses image sources and models. Describe the image style you want in additionalInstructions; you can't pin a model or turn off a source from the request.

  • cardOptions.dimensions and cardOptions.headerFooter: no request field. Use a templateId whose layout already has the dimensions, logo, or footer you need.

  • cardSplit: "inputTextBreaks": no field. If each section must be its own slide, say so in prompt, and check the slide boundaries in the output.

  • format: "webpage" and multi-page pages: not supported on Gamma 5. Keep those integrations on POST /generations.

Slide count and branding

  • numCards is 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 returns 400.

  • On Classic, omitting themeId applies the workspace default theme. Gamma 5 has no default: without themeId or templateId the agent picks a look. Pass themeId for your theme, or templateId to start from an approved template. Don't send both; the request fails with 400.

  • sharingOptions and folderId work as before. A setting that a workspace admin restricts is ignored and reported in warnings on 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:

Check
What to look at

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[].id from GET /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 with templateId returns 400, and the template's own look is the brand. To change the look, save a template with that theme.

  • Title: there is no title field; ask for the title in prompt.

See Generate from approved templates for the full template workflow.

Last updated

Was this helpful?