Create from Template API parameters explained

What Create from Template API parameters represent and how they affect your Gamma creation. Read this before heading to the API Reference page.

🚧

The Create from Template API is currently in beta.

Functionality, rate limits, and pricing are subject to change.

The sample API requests below shows all required and optional API parameters, as well as sample responses.

curl --request POST \
     --url https://public-api.gamma.app/v1.0/generations/from-template \
     --header 'Content-Type: application/json' \
     --header 'X-API-KEY: sk-gamma-xxxxxxxx' \
     --data '
{
  "gammaId": "g_abcdef123456ghi",
  "prompt": "Rework this pitch deck for a non-technical audience.",
  "themeId": "Chisel",
  "folderIds": ["123abc456", "456def789"],
  "exportAs": "pdf"
  "imageOptions": {
    "model": "imagen-4-pro",
    "style": "photorealistic"
  },
  "sharingOptions": {
    "workspaceAccess": "view",
    "externalAccess": "noAccess",
    "emailOptions": {
      "recipients": ["[email protected]"],
      "access": "comment"
    }
  },
}
'
{
  "generationId": "yyyyyyyyyy"
}
{
  "message": "Input validation errors: 1. …",
  "statusCode": 400
}
{
  "message": "Forbidden",
  "statusCode": 403
}
curl --request GET \
     --url https://public-api.gamma.app/v1.0/generations/yyyyyyyyyy \
     --header 'X-API-KEY: sk-gamma-xxxxxxxx' \
     --header 'accept: application/json'
{
  "status": "pending",
  "generationId": "XXXXXXXXXXX"
}
{
  "generationId": "XXXXXXXXXXX",
  "status": "completed",
  "gammaUrl": "https://gamma.app/docs/yyyyyyyyyy",
  "credits":{"deducted":150,"remaining":3000}
}
{
  "message": "Generation ID not found. generationId: xxxxxx",
  "statusCode": 404,
  "credits":{"deducted":0,"remaining":3000}
}

Top level parameters

gammaId (required)

Identifies the template you want to modify. You can find and copy the gammaId for a template as shown in the screenshots below.

prompt (required)

Use this parameter to send text content, image URLs, as well as instructions for how to use this content in relation to the template gamma.

Add images to the input

You can provide URLs for specific images you want to include. Simply insert the URLs into your content where you want each image to appear (see example below). You can also add instructions for how to display the images, eg, "Group the last 10 images into a gallery to showcase them together."

Token limits

The total token limit is 100,000, which is approximately 400,000 characters, but because part of your input is the gamma template, in practice, the token limit for your prompt becomes shorter. We highly recommend keeping your prompt well below 100,000 tokens and testing out a variety of inputs to get a good sense of what works for your use case.

Other tips

  • Text can be as little as a few words that describe the topic of the content you want to generate.
  • You can also input longer text -- pages of messy notes or highly structured, detailed text.
  • You may need to apply JSON escaping to your text. Find out more about JSON escaping and try it out here.
"prompt": "Change this pitch deck about deep sea exploration into one about space exploration."
"prompt": "Change this pitch deck about deep sea exploration into one about space exploration. Use this quote and this image in the title card: That's one small step for man, one giant leap for mankind - Neil Armstrong, https://www.global-aero.com/wp-content/uploads/2020/06/ga-iss.jpg"

themeId (optional, defaults to the template's theme)

Defines which theme from Gamma will be used for the output. Themes determine the look and feel of the gamma, including colors and fonts.

  • You can use the GET Themes endpoint to pull a list of themes from your workspace. Or you can copy over the themeId from the app directly.
"themeId": "abc123def456ghi"

folderIds (optional)

Defines which folder(s) your gamma is stored in.

  • You can use the GET Folders endpoint to pull a list of folders. Or you can copy over the folderIds from the app directly.

  • You must be a member of a folder to be able to add gammas to that folder.
"folderIds": ["123abc456", "def456789"]

exportAs (optional)

Indicates if you'd like to return the generated gamma as a PDF or PPTX file as well as a Gamma URL.

  • Options are pdf or pptx
  • Download the files once generated as the links will become invalid after a period of time.
  • If you do not wish to directly export to a PDF or PPTX via the API, you may always do so later via the app.
"exportAs": "pdf"

imageOptions

When you create content from a Gamma template, new images automatically match the image source used in the original template. For example if you used Pictographic images to generate your original template, any new images will be sourced from Pictographic.

For templates with AI-generated images, you can override the default AI image settings using the optional parameters below.

imageOptions.model (optional)

This field is relevant if the original template was created using AI generated images. The imageOptions.model parameter determines which model is used to generate new images.

  • You can choose from the models listed here.
  • If no value is specified for this parameter, Gamma automatically selects a model for you.
"imageOptions": {
	"model": "flux-1-pro"
  }

imageOptions.style (optional)

This field is relevant if the original template was created using AI generated images. The imageOptions.style parameter influences the artistic style of the images generated.

  • You can add one or multiple words to define the visual style of the images you want.
  • Adding some direction -- even a simple one word like "photorealistic" -- can create visual consistency among the generated images.
  • Character limits: 1-500.
"imageOptions": {
	"style": "minimal, black and white, line art"
  }

sharingOptions

sharingOptions.workspaceAccess (optional, defaults to workspace share settings)

Determines level of access members in your workspace will have to your generated gamma.

  • Options are: noAccess, view, comment, edit, fullAccess
  • fullAccessallows members from your workspace to view, comment, edit, and share with others.
"sharingOptions": {
	"workspaceAccess": "comment"
}

sharingOptions.externalAccess (optional, defaults to workspace share settings)

Determines level of access members outside your workspace will have to your generated gamma.

  • Options are: noAccess, view, comment, or edit
"sharingOptions": {
	"externalAccess": "noAccess"
}

sharingOptions.emailOptions (optional)

sharingOptions.emailOptions.recipients (optional)

Allows users to share gamma with specific recipients via their email.

"sharingOptions": {
  "emailOptions": {
    "recipients": ["[email protected]", "[email protected]"]
}

sharingOptions.emailOptions.access (optional)

Determines level of access users defined in sharingOptions.emailOptions.recipients have to your generated gamma.

  • Options are: view, comment, edit, or fullAccess
"sharingOptions": {
  "emailOptions": {
    "access": "comment"
}