---
title: "List input items for a previously generated response."
method: GET
path: "/v1/responses/{response_id}/input_items"
tags: ["v1"]
---

# List input items for a previously generated response.

`GET /v1/responses/{response_id}/input_items`

Returns a paginated list of the input items that were part of the
conversation context for the given response.

## Path parameters

- `response_id` string, required

## Query parameters

- `limit` integer
- `order` 'asc' | 'desc' — Sort order for paginated listings.
- `after` string

## Response `200`

Success

- ListInputItemsResponse — A paginated list of input items for a stored response.
  - `data` InputItemEntry[], required — The list of input items.
    - union
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `content` union, required
          - string — Text input.
          - ModelInputContentItem[] — A list of input items to the model. Can include text and images.
            - union
              - …
        - `name` string, nullable — A unique identifier representing your end-user, which can help xAI to monitor and detect abuse. Only supported for `user` messages.
        - `role` string, required — The role of the message. Possible values are `user`, `assistant`, `system` and `developer`.
        - `type` string, nullable — The type of the message, which is always `message`.
        - `id` string, required — Stable identifier for this item within the response.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `content` OutputMessageContent[], required — Content of the output message.
          - union
            - object — Text output.
              - …
            - object — Refusal.
              - …
        - `id` string, required — Stable identifier for this item within the response.
        - `role` string, required — The role of the output message, which can be `assistant` or `tool`.
        - `status` string — Status of the item. One of `completed`, `in_progress` or `incomplete`.
        - `type` string, required — The type of the output message, which is always `message`.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `arguments` string, required — The arguments to pass to the function, as a JSON string.
        - `call_id` string, required — The unique ID of the function tool call generated by the model.
        - `id` string, required — Stable identifier for this item within the response.
        - `name` string, required — The name of the function.
        - `status` string — Status of the item. One of `completed`, `in_progress` or `incomplete`.
        - `type` string, required — The type of the function tool call, which can be `"function_call"` for client-side tool calls, and `"web_search_call"` or `"x_search_call"` or `"code_interpreter_call"` or `"mcp_call"` for server-side tool calls.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `content` ReasoningText[] — The reasoning text contents.
          - `text` string, required — Reasoning done by the model.
          - `type` string, required — The type of the object, which is always `reasoning_text`.
        - `encrypted_content` string, nullable — The enrypted reasoning. Returned when `reasoning.encrypted_content` is passed in `include`.
        - `id` string, required — Stable identifier for this item within the response.
        - `status` string — Status of the item. One of `completed`, `in_progress` or `incomplete`.
        - `summary` SummaryText[], required — The summarized reasoning text contents.
          - `text` string, required — Summary of the reasoning done by the model.
          - `type` string, required — The type of the object, which is always `summary_text`.
        - `type` string, required — The type of the object, which is always `reasoning`.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `action` union, required
          - object — Action type "search" - Performs a web search query.
            - `query` string, required — The search query.
            - `sources` WebSearchSource[] — The sources used in the search.
              - …
            - `type` 'search', required
          - object — Action type "open_page" - Opens a specific URL from search results.
            - `type` 'open_page', required
            - `url` string, required — The URL of the page to open.
          - object — Action type "find_in_page": Searches for a pattern within a loaded page. Wire shape mirrors OpenAI's `ActionFind` so the OpenAI Python SDK's typed `web_search_call.action` parses correctly — note the `find_in_page` tag (not `find`) and the flat `url` (not nested under a `source` field).
            - `pattern` string, required — The pattern or text to search for within the page.
            - `type` 'find_in_page', required
            - `url` string, required — The URL of the page being searched within.
        - `id` string, required — Stable identifier for this item within the response.
        - `status` string — The status of the web search tool call.
        - `type` string, required — The type of the web search tool call. Always `web_search_call`.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `id` string, required — Stable identifier for this item within the response.
        - `queries` string[], required — The queries used to search for files.
        - `results` FileSearchResult[], required — The results of the file search tool call.
          - `file_id` string, required — The file ID of the file search result.
          - `filename` string, required — The filename of the file search result.
          - `score` number, double — The score of the file search result. Proto3 omits float fields with value 0.0; default to 0.0 when absent.
          - `text` string, required — The text of the file search result.
        - `status` string — The status of the file search tool call.
        - `type` string, required — The type of the file search tool call. Always `file_search_call`.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `code` string — The code of the code interpreter tool call.
        - `id` string, required — Stable identifier for this item within the response.
        - `outputs` CodeInterpreterOutput[], required — The outputs of the code interpreter tool call.
          - union
            - object — The output of the code interpreter tool call.
              - …
            - object — The error of the code interpreter tool call.
              - …
        - `status` string — The status of the code interpreter tool call.
        - `type` string, required — The type of the code interpreter tool call. Always `code_interpreter_call`.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `arguments` string, required — A JSON string of the arguments passed to the tool.
        - `error` string — The error message of the MCP tool call.
        - `id` string, required — Stable identifier for this item within the response.
        - `name` string, required — The name of the tool that was run.
        - `output` string, required — The output of the MCP tool call.
        - `server_label` string, required — The label of the MCP server running the tool.
        - `status` string — The status of the MCP tool call.
        - `type` string, required — The type of the MCP tool call. Always `mcp_call`.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `call_id` string, required — The unique ID of the function tool call generated by the model.
        - `id` string, required — Stable identifier for this item within the response.
        - `input` string — The unique ID of the custom tool call,
        - `name` string, required — An identifier used to map this custom tool call to a tool call output.
        - `status` string — Status of the item. One of `completed`, `in_progress` or `incomplete`.
        - `type` string, required — The input for the custom tool call generated by the model.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `action` ShellCallAction, required — The shell commands and limits that describe how to run the tool call.
          - `commands` string[], required — The commands to run.
          - `max_output_length` integer, nullable — Optional maximum number of characters to return from each command.
          - `timeout_ms` integer, nullable — Optional timeout in milliseconds for the commands.
          - `type` string, nullable — The type of the action, which is always `exec`.
        - `call_id` string, required — The unique ID of the shell tool call generated by the model.
        - `environment` ShellEnvironment — The environment configuration for a shell tool.
          - `skills` LocalShellSkill[] — An optional list of skills available in the local environment.
            - `description` string, required — A description of what the skill does.
            - `name` string, required — The name of the skill.
            - `path` string, required — The path to the directory containing the skill (with a SKILL.md file).
          - `type` string, required — The type of the environment. Currently only `local` is supported.
        - `id` string, required — Stable identifier for this item within the response.
        - `status` string — Status of the item. One of `completed`, `in_progress` or `incomplete`.
        - `type` string, required — The type of the output item, which is always `shell_call`.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `id` string, required — Stable identifier for this item within the response.
        - `prompt` string, nullable — The prompt used to generate the image.
        - `result` string, nullable — The generated image encoded in base64 (OpenAI-compatible: bare base64, no data-URL prefix), or `null` while the call is still in progress or has failed. The image format can be determined from the decoded magic bytes (typically JPEG or PNG).
        - `status` string — The status of the image generation tool call. One of `in_progress`, `generating`, `completed` or `failed`.
        - `type` 'image_generation_call', required — Type tag for [`ImageGenerationCall`]. Serializes as `"image_generation_call"`. A single-variant enum rather than a `String`: `ImageGenerationCall` lives in the untagged `ModelOutput` / `ModelInputPart` enums and every other field is defaulted or optional, so with a plain `String` type field the struct would match *any* JSON object carrying a `type` key — swallowing `function_call_output` (and similar) input items before their own variants are tried.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `call_id` string, required — The unique ID of the function tool call generated by the model.
        - `output` union, required
          - string — Text input.
          - ModelInputContentItem[] — A list of input items to the model. Can include text and images.
            - union
              - …
        - `type` string, required — The type of the function tool call, which is always `function_call_output`.
        - `id` string, required — Stable identifier for this item within the response.
      - object — A single entry in the input items list, wrapping a `ModelInputPart` with an ID.
        - `call_id` string, required — The unique ID of the shell tool call generated by the model.
        - `max_output_length` integer, nullable — The maximum length of the shell command output. Generated by the model and should be passed back with the raw output.
        - `output` ShellCallOutputResult[], required — An array of shell call output contents.
          - `outcome` union, required — The outcome of a shell command execution.
            - object — The command exited normally.
              - …
            - object — The command timed out.
              - …
          - `stderr` string — The standard error output that was captured.
          - `stdout` string — The standard output that was captured.
        - `type` string, required — The type of the output item, which is always `shell_call_output`.
        - `id` string, required — Stable identifier for this item within the response.
  - `first_id` string, nullable — The ID of the first item in the list.
  - `has_more` boolean, required — Whether there are more items beyond this page.
  - `last_id` string, nullable — The ID of the last item in the list.
  - `object` string, required — The object type, always `list`.

## Other responses

- `400` — Bad request.
- `404` — Not found. No responses could be found with the given response_id.

---

[API](https://skmtc.net/x/apis/xai-s-rest-api.md) · [All operations](https://skmtc.net/x/apis/xai-s-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/x/xai-s-rest-api/versions/8f6014272113/schema)
