NAME

OpenAPI::Client::OpenAI::Path::conversations-conversation_id-items - Documentation for the /conversations/{conversation_id}/items path.

OPERATIONS

GET /conversations/{conversation_id}/items

listConversationItems

$client->list_conversation_items({
    body => { ... },
});

List all items for a conversation with the given ID.

Path/query parameters

  • conversation_id (in path, required, string) - The ID of the conversation to list items for.

  • limit (in query, optional, integer) - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

    Default: 20

  • order (in query, optional, string) - The order to return the input items in. Default is desc . - asc : Return the input items in ascending order. - desc : Return the input items in descending order.

    Allowed values: asc, desc

  • after (in query, optional, string) - An item ID to list items after, used in pagination.

  • include (in query, optional, array) - Specify additional output data to include in the model response. Currently supported values are: - web_search_call.action.sources : Include the sources of the web search tool call. - code_interpreter_call.outputs : Includes the outputs of python code execution in code interpreter tool call items. - computer_call_output.output.image_url : Include image urls from the computer call output. - file_search_call.results : Include the search results of the file search tool call. - message.input_image.image_url : Include image urls from the input message. - message.output_text.logprobs : Include logprobs with assistant messages. - reasoning.encrypted_content : Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false , or when an organization is enrolled in the zero data retention program).

Responses

200 - OK

Content-Type: application/json

Example:

{
   "data" : [
      {
         "content" : [
            {
               "text" : "string",
               "type" : "input_text"
            }
         ],
         "id" : "string",
         "phase" : "commentary",
         "role" : "unknown",
         "status" : "in_progress",
         "type" : "message"
      }
   ],
   "first_id" : "string",
   "has_more" : false,
   "last_id" : "string",
   "object" : "list"
}

POST /conversations/{conversation_id}/items

createConversationItems

$client->create_conversation_items({
    body => { ... },
});

Create items in a conversation with the given ID.

Path/query parameters

  • conversation_id (in path, required, string) - The ID of the conversation to add the item to.

  • include (in query, optional, array) - Additional fields to include in the response. See the include parameter for listing Conversation items above for more information.

Request body

Content-Type: application/json

Properties:

  • items (array of InputItem, required) - The items to add to the conversation. You may add up to 20 items at a time.

Example:

{
   "items" : [
      {
         "content" : "string",
         "phase" : "commentary",
         "role" : "user",
         "type" : "message"
      }
   ]
}

Responses

200 - OK

Content-Type: application/json

Example:

{
   "data" : [
      {
         "content" : [
            {
               "text" : "string",
               "type" : "input_text"
            }
         ],
         "id" : "string",
         "phase" : "commentary",
         "role" : "unknown",
         "status" : "in_progress",
         "type" : "message"
      }
   ],
   "first_id" : "string",
   "has_more" : false,
   "last_id" : "string",
   "object" : "list"
}

SCHEMAS

ConversationItem

A single item within a conversation. The set of possible types are the same as the output type of a Response object .

ConversationItemList

Properties:

  • data (array of ConversationItem, required) - A list of conversation items.

  • first_id (string, required) - The ID of the first item in the list.

  • has_more (boolean, required) - Whether there are more items available.

  • last_id (string, required) - The ID of the last item in the list.

  • object (string, required) - The type of object returned, must be list .

    Allowed values: list

InputItem

See https://platform.openai.com/docs/api-reference for details.

SEE ALSO

OpenAPI::Client::OpenAI::Path

COPYRIGHT AND LICENSE

Copyright (C) 2023-2026 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.