Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

List input items

client.Responses.InputItems.List(ctx, responseID, query) (*CursorPage[ResponseItemUnion], error)
GET/responses/{response_id}/input_items

Returns a list of input items for a given response.

ParametersExpand Collapse
responseID string
query InputItemListParams
ReturnsExpand Collapse
type ResponseItemUnion interface{…}

Content item used to generate a response.

One of the following:
type ResponseInputMessageItem struct{…}
type ResponseOutputMessage struct{…}

An output message from the model.

type ResponseFileSearchToolCall struct{…}

The results of a file search tool call. See the file search guide for more information.

type ResponseComputerToolCall struct{…}

A tool call to a computer use tool. See the computer use guide for more information.

type ResponseComputerToolCallOutputItem struct{…}
type ResponseFunctionToolCallItem struct{…}

A tool call to run a function. See the function calling guide for more information.

type ResponseFunctionToolCallOutputItem struct{…}
type ResponseToolSearchCall struct{…}
type ResponseToolSearchOutputItem struct{…}
type ResponseItemAdditionalTools struct{…}
type ResponseReasoningItem struct{…}

A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your input to the Responses API for subsequent turns of a conversation if you are manually managing context.

type ResponseItemProgram struct{…}
type ResponseItemProgramOutput struct{…}
type ResponseCompactionItem struct{…}

A compaction item generated by the v1/responses/compact API.

type ResponseItemImageGenerationCall struct{…}

An image generation request made by the model.

type ResponseCodeInterpreterToolCall struct{…}

A tool call to run code.

type ResponseItemLocalShellCall struct{…}

A tool call to run a command on the local shell.

type ResponseItemLocalShellCallOutput struct{…}

The output of a local shell tool call.

type ResponseFunctionShellToolCall struct{…}

A tool call that executes one or more shell commands in a managed environment.

type ResponseFunctionShellToolCallOutput struct{…}

The output of a shell tool call that was emitted.

type ResponseApplyPatchToolCall struct{…}

A tool call that applies file diffs by creating, deleting, or updating files.

type ResponseApplyPatchToolCallOutput struct{…}

The output emitted by an apply patch tool call.

type ResponseItemMcpListTools struct{…}

A list of tools available on an MCP server.

type ResponseItemMcpApprovalRequest struct{…}

A request for human approval of a tool invocation.

type ResponseItemMcpApprovalResponse struct{…}

A response to an MCP approval request.

type ResponseItemMcpCall struct{…}

An invocation of a tool on an MCP server.

type ResponseCustomToolCallItem struct{…}

A call to a custom tool created by the model.

type ResponseCustomToolCallOutputItem struct{…}

The output of a custom tool call from your code, being sent back to the model.

List input items

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
  "github.com/openai/openai-go/responses"
)

func main() {
  client := openai.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Responses.InputItems.List(
    context.TODO(),
    "response_id",
    responses.InputItemListParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "object": "list",
  "data": [
    {
      "id": "msg_abc123",
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Tell me a three sentence bedtime story about a unicorn."
        }
      ]
    }
  ],
  "first_id": "msg_abc123",
  "last_id": "msg_abc123",
  "has_more": false
}
Returns Examples
{
  "object": "list",
  "data": [
    {
      "id": "msg_abc123",
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "Tell me a three sentence bedtime story about a unicorn."
        }
      ]
    }
  ],
  "first_id": "msg_abc123",
  "last_id": "msg_abc123",
  "has_more": false
}