> For the complete documentation index, see [llms.txt](https://developers.gamma.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.gamma.app/generations/get-generation-status.md).

# GET /generations/{id}

Use this endpoint to poll an existing generation until `status` is `completed` or `failed`. This is where you receive `gammaUrl`, `exportUrl`, and `credits`.

### How polling works

After starting a generation with `POST /generations` or `POST /generations/from-template`, poll this endpoint every 5 seconds using the returned `generationId`. Most generations complete within 1-3 minutes.

### Generation states

| Status      | Meaning              | What to do                                        |
| ----------- | -------------------- | ------------------------------------------------- |
| `pending`   | Still generating     | Keep polling every 5 seconds                      |
| `completed` | Done                 | Stop polling — use the URLs and credit data below |
| `failed`    | Something went wrong | Stop polling — check the `error` object           |

### What you get back on completion

| Field               | Description                                                                                                                                                                                              |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gammaUrl`          | Link to view or share the generated Gamma                                                                                                                                                                |
| `exportUrl`         | Download URL for the exported file (if `exportAs` was set). Format matches `exportAs`: `pdf` and `pptx` download directly; `png` returns a `.zip` with one PNG per card. Signed, expires after \~1 week. |
| `gammaId`           | The file ID (e.g. `g_l0mf2jvf1fpmi1v`). Use this for `POST /gammas/{gammaId}/archive` or `DELETE /gammas/{gammaId}`.                                                                                     |
| `credits.deducted`  | Credits consumed by this generation                                                                                                                                                                      |
| `credits.remaining` | Credits left in the workspace after this generation                                                                                                                                                      |

## Get generation status

> Retrieves the current status of a generation job. Poll this endpoint until status is "completed" or "failed".

```json
{"openapi":"3.0.0","info":{"title":"Gamma Public API","version":"1.0"},"tags":[{"name":"public-api","description":"Public API endpoints for external integrations"}],"servers":[{"url":"https://public-api.gamma.app","description":"Production"}],"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key for authentication"}},"schemas":{"GenerationStatusResponse":{"type":"object","properties":{"generationId":{"type":"string","description":"Unique identifier for the generation job"},"status":{"type":"string","description":"Current status of the generation job","enum":["failed","pending","completed"]},"gammaId":{"type":"string","description":"File ID of the generated Gamma (when completed)"},"gammaUrl":{"type":"string","description":"URL to the generated Gamma (when completed)"},"error":{"description":"Error details (when failed)","allOf":[{"$ref":"#/components/schemas/ErrorResponse"}]},"exportUrl":{"type":"string","description":"URL to download the exported file (when exportAs was specified).\nThe file format matches exportAs: `pptx` → .pptx, `pdf` → .pdf, `png` → a .zip archive containing one PNG per card (not a single PNG file).\nThe URL is signed and expires after approximately one week."},"credits":{"description":"Credit usage information","allOf":[{"$ref":"#/components/schemas/CreditsResponse"}]}},"required":["generationId","status"]},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error message"},"statusCode":{"type":"number","description":"HTTP status code"}},"required":["message","statusCode"]},"CreditsResponse":{"type":"object","properties":{"deducted":{"type":"number","description":"Number of credits deducted for this operation"},"remaining":{"type":"number","description":"Remaining credits in the workspace"}},"required":["deducted","remaining"]}}},"paths":{"/v1.0/generations/{id}":{"get":{"description":"Retrieves the current status of a generation job. Poll this endpoint until status is \"completed\" or \"failed\".","operationId":"getGenerationStatus","parameters":[{"name":"id","required":true,"in":"path","description":"The unique generation ID returned from the create endpoint","schema":{"type":"string"}}],"responses":{"200":{"description":"Generation status retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationStatusResponse"}}}},"400":{"description":"Invalid request parameters"},"401":{"description":"Invalid or missing API key"},"404":{"description":"Generation not found"}},"summary":"Get generation status","tags":["public-api"]}}}}
```

{% hint style="info" %}
For usage patterns, see [Poll for results](/guides/async-patterns-and-polling.md).
{% endhint %}

## Related

* [Poll for results](/guides/async-patterns-and-polling.md) for complete polling implementations
* [POST /generations](/generations/create-generation.md) if you need to start a new generation first


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.gamma.app/generations/get-generation-status.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
