| description | layout | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Build with the Gamma API — generate presentations, documents, websites, and social posts programmatically. |
|
{% columns %} {% column valign="middle" %} One API call. Polished presentations, documents, websites, and social posts — branded, exported, and shared.
Get your API keyAPI overview {% endcolumn %}
{% column %}
{% endcolumn %} {% endcolumns %}All requests require an API key in the X-API-KEY header. Generate a key from Account Settings > API Keys.
| Header | Value | Required |
|---|---|---|
X-API-KEY |
Your API key | Yes |
Content-Type |
application/json |
Yes |
API key access requires a Pro, Ultra, Teams, or Business plan. Some connectors work on all plans and do not require an API key.
{% tabs %} {% tab title="cURL" %}
curl -X POST https://public-api.gamma.app/v1.0/generations \
-H "Content-Type: application/json" \
-H "X-API-KEY: $GAMMA_API_KEY" \
-d '{
"inputText": "Q3 product launch strategy",
"textMode": "generate",
"format": "presentation",
"numCards": 10,
"exportAs": "pdf"
}'{% endtab %}
{% tab title="Python" %}
import requests, os
response = requests.post(
"https://public-api.gamma.app/v1.0/generations",
headers={
"X-API-KEY": os.environ["GAMMA_API_KEY"],
"Content-Type": "application/json",
},
json={
"inputText": "Q3 product launch strategy",
"textMode": "generate",
"format": "presentation",
"numCards": 10,
"exportAs": "pdf",
},
)
generation_id = response.json()["generationId"]{% endtab %}
{% tab title="JavaScript" %}
const response = await fetch(
"https://public-api.gamma.app/v1.0/generations",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": process.env.GAMMA_API_KEY,
},
body: JSON.stringify({
inputText: "Q3 product launch strategy",
textMode: "generate",
format: "presentation",
numCards: 10,
exportAs: "pdf",
}),
}
);
const { generationId } = await response.json();{% endtab %} {% endtabs %}
{% code title="Response" %}
{
"generationId": "abc123xyz"
}{% endcode %}
Poll GET /v1.0/generations/{generationId} every 5 seconds until status is completed or failed. Full polling examples in Poll for results.
{% code title="Response (completed)" %}
{
"generationId": "abc123xyz",
"status": "completed",
"gammaUrl": "https://gamma.app/docs/abc123",
"exportUrl": "https://gamma.app/export/abc123.pdf",
"credits": {
"deducted": 15,
"remaining": 485
}
}{% endcode %}
Your presentation is live at gammaUrl. If you specified exportAs, the file is ready at exportUrl.
{% hint style="info" %}
Getting a 401? Gamma uses X-API-KEY as a custom header — not Authorization: Bearer. See Error codes for other common issues.
{% endhint %}
| Endpoint | Method | Description |
|---|---|---|
| /generations | POST | Generate from text |
| /generations/from-template | POST | Generate from template |
| /generations/{id} | GET | Poll generation status |
| /themes | GET | List workspace themes |
| /folders | GET | List workspace folders |
{% hint style="success" %} Building an AI integration? The MCP server lets AI tools create gammas on behalf of users via OAuth with Dynamic Client Registration. {% endhint %}
| Generate from text | Control format, themes, images, headers/footers, and sharing. | Generate from text |
| Generate from a template | Design a template once, then generate variations programmatically. | Generate from template |
| Connect integrations | Use Gamma with AI assistants and automation platforms — some require no API key. | Connectors |
| Set up the MCP server | Let AI tools create gammas on behalf of users via OAuth. | MCP Server |
