> For the complete documentation index, see [llms.txt](https://docs.apismart.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apismart.ai/api-usage/generated-media-history.md).

# Generated Media History

Learn how to retrieve recent image and video generation history, review generated media URLs, costs, timestamps, and storage status.

ApiSmart provides dedicated APIs for retrieving your recent generated images and videos.

Use these endpoints to review completed media generations, access stored result URLs, check generation details, and retrieve recent output programmatically.

### 🖼️ Image History

Use the Image History API to retrieve your recent generated images.

**Method:** `GET`

**Endpoint:** `/v1/images`

**Full URL:**

`https://gw.apismart.ai/v1/images`

Example:

```bash
curl "https://gw.apismart.ai/v1/images?page=1&page_size=20" \
  -H "Authorization: Bearer <your-api-key>"
```

No request body is required.

#### Query Parameters

| Parameter   | Type    | Default | Description                           |
| ----------- | ------- | ------: | ------------------------------------- |
| `page`      | integer |     `1` | Page number, starting from 1          |
| `page_size` | integer |    `20` | Number of records per page, up to 100 |

#### Example Response

```json
{
  "object": "list",
  "data": [
    {
      "id": "cv8k2p3l9abc",
      "model": "doubao-seedream-5-0",
      "urls": [
        "https://oss.apismart.ai/image/2026-07-16/cv8k2p3l9abc.jpg",
        "https://oss.apismart.ai/image/2026-07-16/cv8k2p3l9abc_2.jpg"
      ],
      "image_count": 2,
      "resolution": "2048x2048",
      "cost": "0.44",
      "created": 1721107800,
      "created_at": "2026-07-16 10:30:00",
      "on_our_storage": true
    }
  ],
  "page": 1,
  "page_size": 20,
  "has_more": true
}
```

#### Image History Fields

| Field            | Description                                                   |
| ---------------- | ------------------------------------------------------------- |
| `id`             | Unique identifier for the generation record                   |
| `model`          | Model ID used for generation                                  |
| `urls`           | Generated image URLs associated with the generation           |
| `image_count`    | Number of images generated                                    |
| `resolution`     | Generated image resolution                                    |
| `cost`           | Actual amount charged for the generation                      |
| `created`        | Generation time as a Unix timestamp                           |
| `created_at`     | Generation time in local date and time format                 |
| `on_our_storage` | Whether all results have been transferred to ApiSmart storage |
| `has_more`       | Whether another page of results is available                  |

For multi-image or sequential-generation requests, `urls` can contain multiple generated image results.

### 🎬 Video History

Use the Video History API to retrieve recently completed video generations.

**Method:** `GET`

**Endpoint:** `/v1/videos`

**Full URL:**

`https://gw.apismart.ai/v1/videos`

Example:

```bash
curl "https://gw.apismart.ai/v1/videos?page=1&page_size=20" \
  -H "Authorization: Bearer <your-api-key>"
```

#### Query Parameters

| Parameter   | Type    | Default | Description                           |
| ----------- | ------- | ------: | ------------------------------------- |
| `page`      | integer |     `1` | Page number, starting from 1          |
| `page_size` | integer |    `20` | Number of records per page, up to 100 |

#### Example Response

```json
{
  "object": "list",
  "data": [
    {
      "id": "cv9m4x7q2def",
      "task_id": "task_2026xxxxxx",
      "model": "happyhorse-1.0",
      "urls": [
        "https://oss.apismart.ai/video/2026-07-16/cv9m4x7q2def.mp4"
      ],
      "duration": 5,
      "resolution": "720p",
      "cost": "0.725",
      "created": 1721107800,
      "created_at": "2026-07-16 10:30:00",
      "on_our_storage": true
    }
  ],
  "page": 1,
  "page_size": 20,
  "has_more": false
}
```

#### Video History Fields

| Field            | Description                                                |
| ---------------- | ---------------------------------------------------------- |
| `id`             | Unique identifier for the generated video record           |
| `task_id`        | Video task ID associated with the generation               |
| `model`          | Model ID used for generation                               |
| `urls`           | Generated video URL                                        |
| `duration`       | Generated video duration in seconds                        |
| `resolution`     | Generated video resolution                                 |
| `cost`           | Actual amount charged for the generation                   |
| `created`        | Generation time as a Unix timestamp                        |
| `created_at`     | Generation time in local date and time format              |
| `on_our_storage` | Whether the video has been transferred to ApiSmart storage |
| `has_more`       | Whether another page of results is available               |

Only **successfully generated videos** appear in Video History.

Queued, running, failed, or cancelled video tasks are not included.

### 🔄 Video History vs. Video Task Status

Video History and Video Task Status serve different purposes.

| API                        | Purpose                                                      |
| -------------------------- | ------------------------------------------------------------ |
| `GET /v1/video/tasks/{id}` | Check the current status of a specific video generation task |
| `GET /v1/videos`           | Review recently completed video generations                  |

Use the task endpoint while a video is still being generated.

Use Video History after generation succeeds and you want to review completed results.

### 💾 Media Storage Status

The `on_our_storage` field indicates whether generated media has been transferred to ApiSmart-managed storage.

#### `true`

The generated media has been transferred to ApiSmart storage.

#### `false`

The result may still be in the process of being transferred and may temporarily reference a short-lived result URL.

For important generated media, save the final result to your own storage rather than relying on history or temporary URLs as permanent storage.

### 🕘 History Availability

Image and video history endpoints currently allow you to query records from the most recent **7 days**.

Records older than the available history window cannot be retrieved through these list endpoints.

For images, generated files may remain in storage longer than the searchable history index, so you should save important output URLs or files before they are no longer available through the history API.

> Generated Media History is designed for reviewing recent results, not as permanent media storage.

### 💰 Review Generation Costs

Both image and video history records can include a `cost` field showing the actual amount charged for that generation.

Use this field when you want to review the cost associated with a specific media result.

For broader request-level usage and cost information, use [**Usage Logs and Costs**](/api-usage/usage-logs-and-costs.md).

For information about how image and video costs are calculated, see [**Model Pricing and Billing**](/models-and-pricing/model-pricing-and-billing.md).

### 🔍 When to Use Generated Media History

Generated Media History is useful when you need to:

* Review recently generated images or videos
* Retrieve a previously generated media URL
* Check which model produced a result
* Review generation time
* Check image count or video duration
* Review the cost of a specific generation
* Confirm whether a result has been transferred to ApiSmart storage
* Associate a completed video with its original `task_id`

### ⚠️ If a Result Is Missing

If you cannot find a generated result:

1. **Check the history window**\
   Only recent records are available through the history APIs.
2. **For video, check the task status**\
   Videos that are still `queued` or `running` do not appear in Video History.
3. **Confirm that generation succeeded**\
   Failed video tasks are not included in the completed video history list.
4. **Check the correct account and API Key**\
   Make sure you are reviewing activity associated with the expected ApiSmart account.

For request-level troubleshooting, see [**Usage Logs and Costs**](/api-usage/usage-logs-and-costs.md) and [**HTTP Status Codes and API Errors**](/troubleshooting/http-status-codes-and-api-errors.md).

### ➡️ Next Steps

Continue with:

* [**Usage Logs and Costs**](/api-usage/usage-logs-and-costs.md) — Review request-level usage, performance, and costs
* [**Image Generation API**](/api-guides/image-generation-api.md) — Generate and edit images
* [**Video Generation API**](/api-guides/video-generation-api.md) — Create and query video generation tasks
* [**Model Pricing and Billing**](/models-and-pricing/model-pricing-and-billing.md) — Understand image and video billing
* [**HTTP Status Codes and API Errors**](/troubleshooting/http-status-codes-and-api-errors.md) — Troubleshoot API failures
