# List Response input items

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

List the input items used by a stored Response. Full-input retrieval depends on the selected model service.

```text
GET https://token.moi.matrixorigin.cn/v1/responses/$RESPONSE_ID/input_items
```

## Before you begin

1. [Create a Response](../text-generation/responses.md#request-body) with storage enabled on a model service that supports storage and retrieval. Select a response that is still accessible and has not been deleted or expired.
2. Prepare the [personal access token](../../../../guides/billing/credentials.md#personal-access-token) used to create that response.

## Request example

Replace `$GENESIS_ACCESS_TOKEN` and `$RESPONSE_ID` with your personal access token and the selected response ID.

### Without pagination parameters

```bash
curl -X GET \
  "https://token.moi.matrixorigin.cn/v1/responses/$RESPONSE_ID/input_items" \
  -H "Authorization: Bearer $GENESIS_ACCESS_TOKEN"
```

### Read the first page

```bash
curl --get \
  "https://token.moi.matrixorigin.cn/v1/responses/$RESPONSE_ID/input_items" \
  -H "Authorization: Bearer $GENESIS_ACCESS_TOKEN" \
  --data-urlencode 'limit=1' \
  --data-urlencode 'order=asc'
```

### Read the next page

When `has_more` is `true`, save the previous page's `last_id` as `$LAST_ITEM_ID` and request the next page with the same ordering. Stop when `has_more` is `false`.

```bash
curl --get \
  "https://token.moi.matrixorigin.cn/v1/responses/$RESPONSE_ID/input_items" \
  -H "Authorization: Bearer $GENESIS_ACCESS_TOKEN" \
  --data-urlencode 'limit=1' \
  --data-urlencode 'order=asc' \
  --data-urlencode "after=$LAST_ITEM_ID"
```

## Path parameters

::::{div} mo-api-parameter-table

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `response_id` | string | Yes | Stored Response identifier from `id` in the create response result. |

::::

## Query parameters

::::{div} mo-api-parameter-table

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer | No | Items per page; the example uses `1`. Supported values depend on the model service. |
| `order` | string | No | Ordering: `asc` or `desc`. |
| `after` | string | No | Continue after the previous page's `last_id`. |

::::

## Successful response

A successful request returns the current page of input items and pagination markers.

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "data": [
    {
      "id": "item-example-1",
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Reply with OK."
        }
      ]
    }
  ],
  "first_id": "item-example-1",
  "last_id": "item-example-1",
  "has_more": true
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `data` | array of object | Input items on this page. |
| `data[].id` | string | Input item identifier; can be used as a pagination cursor. |
| `data[].type` | string | Item type; text messages use `message`. |
| `data[].role` | string | Input message role. |
| `data[].content` | array of object | Text blocks in the input message. |
| `data[].content[].type` | string | Text block type `input_text`. |
| `data[].content[].text` | string | Input text. |
| `first_id` | string | Identifier of the first item on this page. |
| `last_id` | string | Identifier of the last item on this page; use it as `after` to continue. |
| `has_more` | boolean | Whether another page exists; stop when `false`. |

:::::
::::::
:::::::

## Error response

HTTP `404` indicates a missing, deleted, expired, or inaccessible response. Check the response ID and the credentials used to create it.

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "error": {
    "message": "response state not found",
    "type": "response_state_not_found",
    "code": "response_state_not_found"
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `error` | object | Error details. |
| `error.message` | string | Description of an unavailable or missing response. |
| `error.type` | string | Error type. |
| `error.code` | string | Error code. |

:::::
::::::
:::::::
