> For the complete documentation index, see [llms.txt](https://diffio.ai/llms.txt). This page is also available as HTML at https://diffio.ai/docs/api-reference/get-generation-export/.

# Get an export

Reads a separated-track export's `status` and, once `status` is `ready`, mints a fresh 6-hour signed `url`.

GET `https://api.diffio.ai/v2/projects/{project_id}/generations/{generation_id}/exports/{export_id}`

- Key scope: `artifacts:read`
- Auth header: `Authorization: Bearer <apiKey>`
- Body: None

## Request

Pass `project_id`, `generation_id`, and `export_id` in the path, and optional `file_name` in the query string.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | string | Yes | Unique identifier of the project. |
| `generation_id` | string | Yes | Unique identifier of the generation within the project. |
| `export_id` | string | Yes | Identifier of the export returned when the export was created. |

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `file_name` | string | No | Optional download filename without an extension; `url` then carries it as `?download=` (ignored for an inline export). |

### Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Diffio-End-User` | string | No | Optional end-user identifier (up to 128 characters). Scopes the request to that end user's projects; omit to act across the whole account. |

## Example request

**Python**

```python
import os
from diffio import DiffioClient

key = os.environ["DIFFIO_API_KEY"]
client = DiffioClient(api_key=key)

export = client.exports.get(
    "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
    "ce832a32-a1ce-516a-b8bd-75457bd8517f",
    "d51fd816be75bc302ecc3def3da4f22d",
    file_name="interview mix",
)
```

**Node.js**

```javascript
import { DiffioClient } from "diffio"

const client = new DiffioClient({
  apiKey: process.env.DIFFIO_API_KEY,
})

const rendered = await client.exports.get(
  "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
  "ce832a32-a1ce-516a-b8bd-75457bd8517f",
  "d51fd816be75bc302ecc3def3da4f22d",
  { file_name: "interview mix" },
)
```

**cURL**

```bash
curl "https://api.diffio.ai/v2/projects/62f62565-049f-5e7e-bbd2-9de0cf7ddbfe/generations/ce832a32-a1ce-516a-b8bd-75457bd8517f/exports/d51fd816be75bc302ecc3def3da4f22d?file_name=interview%20mix" \
  -H "Authorization: Bearer $DIFFIO_API_KEY"
```

## Response

Returns the `generation_export` with a fresh `url` when `status` is `ready`.

Success: `200`

### Response fields

| Field | Type | Present | Description |
| --- | --- | --- | --- |
| `object` | string | Always | Resource type, always `"generation_export"`. |
| `id` | string | Always | Deterministic export identifier (32 hex characters for the recipe, plus `-inline` when `inline` is `true`). |
| `project_id` | string | Always | Identifier of the parent project. |
| `generation_id` | string | Always | Identifier of the generation. |
| `status` | string | Always | Export render state: `queued`, `processing`, `ready`, or `failed`. |
| `artifact` | string \| null | Always | Exported track recipe (`speech`, `background`, `mix`, `both`, or `original`), or `null`. |
| `format` | string \| null | Always | Output container format (`wav`, `mp3`, `m4a`, `mp4`, or `zip`), or `null`. |
| `background_gain` | number \| null | Always | Background gain from `0` to `1` used for a `mix` export; `0` for other artifacts. |
| `leveling` | boolean | Always | True when speech leveling was applied to this export. |
| `inline` | boolean | Always | True when `url` is served for in-page playback rather than as a file download. |
| `url` | string \| null | Always | Signed media URL valid for 6 hours once `status` is `ready`, or `null` while rendering or failed. |
| `error` | object \| null | Always | Failure details when `status` is `failed`, or `null` otherwise. |
| `error.code` | string | Always | Stable `snake_case` export failure code (`export_failed`). |
| `error.message` | string | Always | Human-readable explanation of why export rendering failed. |

## Example response (200)

**Successful response**

```json
{
  "object": "generation_export",
  "id": "d51fd816be75bc302ecc3def3da4f22d",
  "project_id": "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
  "generation_id": "ce832a32-a1ce-516a-b8bd-75457bd8517f",
  "status": "ready",
  "artifact": "mix",
  "format": "mp3",
  "background_gain": 0.3,
  "leveling": false,
  "inline": false,
  "url": "https://media.diffio.io/m/v1.REDACTED/generations/ce832a32-a1ce-516a-b8bd-75457bd8517f/downloads/stems/d51fd816be75bc302ecc3def3da4f22d/98111c08d1f247d0b43a4eeeb50b5e7a/diffio_mix.mp3?download=interview%20mix.mp3",
  "error": null
}
```

## Return codes

- `200`
  - Returns the export status and
  - When `ready`
  - A fresh 6-hour `url`
- `400` `Diffio-End-User` exceeds 128 characters. [`invalid_header`](https://diffio.ai/docs/api-reference/errors/#invalid_header)
- `403` Key is inactive or lacks `artifacts:read`. [`permission_denied`](https://diffio.ai/docs/api-reference/errors/#permission_denied)
- `404`
  - Project not found: [`project_not_found`](https://diffio.ai/docs/api-reference/errors/#project_not_found)
  - Generation not found: [`generation_not_found`](https://diffio.ai/docs/api-reference/errors/#generation_not_found)
  - Export not found: [`export_not_found`](https://diffio.ai/docs/api-reference/errors/#export_not_found)
- `409` Project is being deleted. [`not_available`](https://diffio.ai/docs/api-reference/errors/#not_available)
- `502` Upstream export service error. [`internal_error`](https://diffio.ai/docs/api-reference/errors/#internal_error)
- **`401` `405` Same on every endpoint**

  - `401` Missing API key (code missing_api_key), or invalid API key (code invalid_api_key).
  - `405` HTTP method not supported on this path; check the Allow header (code method_not_allowed).

### Example error response

Errors are JSON: an `error` object with `code`, `message` and `request_id`. An unrecognized key returns `401`:

**Error response**

```json
{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid API key.",
    "request_id": "dead773b60e148fd9e22d680a22fa701"
  }
}
```

## Notes

- Reading an export never triggers a new render; if `status` is `failed`, call [Create an export](https://diffio.ai/docs/api-reference/create-generation-export/) with the same parameters to render it again.
- When `url` expires after 6 hours, call `GET` again to mint a fresh link without re-rendering.

## Related pages

- Previous: [Create an export](https://diffio.ai/docs/api-reference/create-generation-export/): Render a downloadable or inline-playable file from a generation's separated speech and background tracks.
- Next: [Get a generation's transcript](https://diffio.ai/docs/api-reference/get-transcript/): Retrieve a generation's normalized word-timed transcript for display, assistant turns, or Pro edits.

- [Full API guide](https://diffio.ai/docs/developers/full-api-guide/): Every topic, limit and concept in one index.
- [Webhooks guide](https://diffio.ai/docs/developers/webhooks/): Get notified when a generation finishes instead of polling.
