# GET /generations/{id}

Use this endpoint to poll an existing generation until it reaches `completed` or `failed`. This is where you receive `gammaUrl`, `exportUrl`, and credit usage.

## 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":"object","description":"Current status of the generation job"},"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 exported file (when exportAs was specified)"},"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"}}}},"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: 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.
