Gamma.app — Presentations & Documents API
Create presentations, documents, social posts, and web pages programmatically via the Gamma API.
Homepage: https://gamma.app
API Docs: https://developers.gamma.app/docs/getting-started
Runtime dependencies: curl, python3 (for JSON building/parsing)
Setup
Set the environment variable before using:
CODEBLOCK0
The script only makes network calls to https://public-api.gamma.app/v1.0. Your API key and inputText content are sent to Gamma's servers.
Quick Start
Generate a presentation
CODEBLOCK1
Generate a document
CODEBLOCK2
Create from template
CODEBLOCK3
Check status manually
CODEBLOCK4
List themes and folders
CODEBLOCK5
Script Reference
INLINECODE3
Commands
| Command | Args | Description |
|---|
| INLINECODE4 | INLINECODE5 | Create from scratch |
| INLINECODE6 |
"gammaId" "prompt" | Create from existing template |
|
status |
"generationId" | Check generation status |
|
themes |
[query] | List available themes |
|
folders |
[query] | List workspace folders |
Generate Options
| Option | Values | Default |
|---|
| INLINECODE14 | presentation, document, social, webpage | presentation |
| INLINECODE15 |
generate, condense, preserve | generate |
|
--num-cards | 1-60 (Pro) / 1-75 (Ultra) | 10 |
|
--card-split | auto, inputTextBreaks | auto |
|
--theme | theme ID from
themes command | (Gamma picks) |
|
--export | pdf, pptx | (none) |
|
--tone | free text | (none) |
|
--audience | free text | (none) |
|
--language | ISO code (en, es, fr...) | (auto) |
|
--amount | brief, medium, detailed, extensive | (auto) |
|
--image-source | aiGenerated, pexels, noImages, etc. | (auto) |
|
--image-model | flux-1-pro, imagen-4-pro, etc. | (auto) |
|
--image-style | free text ("photorealistic") | (none) |
|
--instructions | additional guidance (max 2000 chars) | (none) |
|
--dimensions | fluid, 16x9, 4x3, 1x1, 4x5, 9x16, a4, letter | fluid |
|
--workspace-access | noAccess, view, comment, edit, fullAccess | (default) |
|
--external-access | noAccess, view, comment, edit | (default) |
|
--folder | folder ID (comma-separated for multiple) | (none) |
|
--wait | (flag) Poll until generation completes | false |
|
--poll-interval | seconds between polls | 5 |
Workflow
- 1. Generate — POST creates the gamma, returns a INLINECODE35
- Poll — Use
--wait or manually check status until INLINECODE38 - Result — Completed response includes
gammaUrl (live link) and export download URL if requested - Credits — Response shows
credits.deducted and INLINECODE41
Input Tips
- - Short prompts work ("AI trends 2026") but detailed structured text produces better results
- Insert image URLs directly in inputText where you want them placed
- Use
\n---\n in inputText to force card breaks (set --card-split inputTextBreaks) - To use only your images (no AI-generated ones), set INLINECODE44
- JSON-escape special characters in inputText
Credit Costs
- - Cards: 1-5 credits each
- AI images: 2 credits (basic) to 125 credits (ultra) per image
- Example: 10-card deck with basic AI images ≈ 20-60 credits
Full API Reference
For complete parameter details, header/footer configuration, and sharing options, read references/api-reference.md.
Gamma.app — 演示文稿与文档 API
通过 Gamma API 以编程方式创建演示文稿、文档、社交媒体帖子和网页。
主页: https://gamma.app
API 文档: https://developers.gamma.app/docs/getting-started
运行时依赖: curl、python3(用于 JSON 构建/解析)
设置
使用前设置环境变量:
bash
export GAMMAAPIKEY=sk-gamma-xxxxx # 从 https://gamma.app/settings 获取
该脚本仅向 https://public-api.gamma.app/v1.0 发起网络请求。您的 API 密钥和 inputText 内容将发送至 Gamma 的服务器。
快速开始
生成演示文稿
bash
bash scripts/gamma.sh generate 面向商业领袖的2026年AI趋势 \
--format presentation --num-cards 10 --export pdf --wait
生成文档
bash
bash scripts/gamma.sh generate 2026年第一季度营销报告 \
--format document --text-mode generate --amount detailed \
--tone 专业 --audience 高管团队 --export pdf --wait
从模板创建
bash
bash scripts/gamma.sh template g_abcdef123 为Twist Broadband客户更新此推介文稿 \
--export pdf --wait
手动检查状态
bash
bash scripts/gamma.sh status generationId123
列出主题和文件夹
bash
bash scripts/gamma.sh themes
bash scripts/gamma.sh themes dark
bash scripts/gamma.sh folders
脚本参考
scripts/gamma.sh <命令> [参数] [选项]
命令
| 命令 | 参数 | 描述 |
|---|
| generate | inputText | 从头创建 |
| template |
gammaId prompt | 从现有模板创建 |
| status | generationId | 检查生成状态 |
| themes | [query] | 列出可用主题 |
| folders | [query] | 列出工作区文件夹 |
生成选项
| 选项 | 值 | 默认值 |
|---|
| --format | presentation, document, social, webpage | presentation |
| --text-mode |
generate, condense, preserve | generate |
| --num-cards | 1-60 (Pro) / 1-75 (Ultra) | 10 |
| --card-split | auto, inputTextBreaks | auto |
| --theme | 来自 themes 命令的主题 ID | (Gamma 自动选择) |
| --export | pdf, pptx | (无) |
| --tone | 自由文本 | (无) |
| --audience | 自由文本 | (无) |
| --language | ISO 代码 (en, es, fr...) | (自动) |
| --amount | brief, medium, detailed, extensive | (自动) |
| --image-source | aiGenerated, pexels, noImages 等 | (自动) |
| --image-model | flux-1-pro, imagen-4-pro 等 | (自动) |
| --image-style | 自由文本 (photorealistic) | (无) |
| --instructions | 额外指导(最多2000字符) | (无) |
| --dimensions | fluid, 16x9, 4x3, 1x1, 4x5, 9x16, a4, letter | fluid |
| --workspace-access | noAccess, view, comment, edit, fullAccess | (默认) |
| --external-access | noAccess, view, comment, edit | (默认) |
| --folder | 文件夹 ID(多个用逗号分隔) | (无) |
| --wait | (标志) 轮询直至生成完成 | false |
| --poll-interval | 轮询间隔秒数 | 5 |
工作流程
- 1. 生成 — POST 创建 gamma,返回 generationId
- 轮询 — 使用 --wait 或手动检查 status 直至 completed
- 结果 — 完成响应包含 gammaUrl(实时链接)以及请求的导出下载 URL
- 积分 — 响应显示 credits.deducted 和 credits.remaining
输入提示
- - 简短提示词有效(AI trends 2026),但详细的结构化文本效果更好
- 在 inputText 中直接插入图片 URL 以指定位置
- 在 inputText 中使用 \n---\n 强制分页(设置 --card-split inputTextBreaks)
- 仅使用自己的图片(不使用 AI 生成的图片),设置 --image-source noImages
- 对 inputText 中的特殊字符进行 JSON 转义
积分成本
- - 卡片:每张 1-5 积分
- AI 图片:每张 2 积分(基础)至 125 积分(极致)
- 示例:10 张卡片搭配基础 AI 图片 ≈ 20-60 积分
完整 API 参考
有关完整参数详情、页眉/页脚配置和共享选项,请阅读 references/api-reference.md。