Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai python Response Item List

From Leeroopedia
Knowledge Sources
Domains API_Types, Responses_API
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete type for representing a paginated list of response items provided by the openai-python SDK.

Description

ResponseItemList is a Pydantic model representing a paginated list of Response items returned by the API. It contains a data field holding a list of ResponseItem objects, first_id and last_id for cursor-based pagination, has_more indicating whether additional items are available, and an object field always set to "list".

Usage

Import this type when working with the response input items list endpoint, which returns paginated collections of items associated with a response.

Code Reference

Source Location

Signature

class ResponseItemList(BaseModel):
    """A list of Response items."""

    data: List[ResponseItem]
    first_id: str
    has_more: bool
    last_id: str
    object: Literal["list"]

Import

from openai.types.responses import ResponseItemList

I/O Contract

Fields

Name Type Required Description
data List[ResponseItem] Yes A list of items used to generate this response.
first_id str Yes The ID of the first item in the list.
has_more bool Yes Whether there are more items available.
last_id str Yes The ID of the last item in the list.
object Literal["list"] Yes The type of object returned. Always list.

Usage Examples

import openai

client = openai.OpenAI()

# List input items for a response
items = client.responses.input_items.list("resp_abc123")

print(f"First ID: {items.first_id}")
print(f"Last ID: {items.last_id}")
print(f"Has more: {items.has_more}")

for item in items.data:
    print(f"Item type: {item.type}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment