List Response input items

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

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

Before you begin

  1. Create a Response 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 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

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

Read the first page

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.

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

Parameter

Type

Required

Description

response_id

string

Yes

Stored Response identifier from id in the create response result.

Query parameters

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.

{
  "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
}

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.

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

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.

Last updated on