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.Beta.Responses.InputItems.List(ctx, responseID, params) (*CursorPage[BetaResponseItemUnion], error)
GET/responses/{response_id}/input_items

Returns a list of input items for a given response.

ParametersExpand Collapse
responseID string
params BetaResponseInputItemListParams
ReturnsExpand Collapse
type BetaResponseItemUnion interface{…}

Content item used to generate a response.

One of the following:
type BetaResponseInputMessageItem struct{…}
type BetaResponseOutputMessage struct{…}

An output message from the model.

type BetaResponseFileSearchToolCall struct{…}

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

type BetaResponseComputerToolCall struct{…}

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

type BetaResponseComputerToolCallOutputItem struct{…}
type BetaResponseFunctionToolCallItem struct{…}

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

type BetaResponseFunctionToolCallOutputItem struct{…}
type BetaResponseItemAgentMessage struct{…}
type BetaResponseItemMultiAgentCall struct{…}
type BetaResponseItemMultiAgentCallOutput struct{…}
type BetaResponseToolSearchCall struct{…}
type BetaResponseToolSearchOutputItem struct{…}
type BetaResponseItemAdditionalTools struct{…}
type BetaResponseReasoningItem 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 BetaResponseItemProgram struct{…}
type BetaResponseItemProgramOutput struct{…}
type BetaResponseCompactionItem struct{…}

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

type BetaResponseItemImageGenerationCall struct{…}

An image generation request made by the model.

type BetaResponseCodeInterpreterToolCall struct{…}

A tool call to run code.

type BetaResponseItemLocalShellCall struct{…}

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

type BetaResponseItemLocalShellCallOutput struct{…}

The output of a local shell tool call.

type BetaResponseFunctionShellToolCall struct{…}

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

type BetaResponseFunctionShellToolCallOutput struct{…}

The output of a shell tool call that was emitted.

type BetaResponseApplyPatchToolCall struct{…}

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

type BetaResponseApplyPatchToolCallOutput struct{…}

The output emitted by an apply patch tool call.

type BetaResponseItemMcpListTools struct{…}

A list of tools available on an MCP server.

type BetaResponseItemMcpApprovalRequest struct{…}

A request for human approval of a tool invocation.

type BetaResponseItemMcpApprovalResponse struct{…}

A response to an MCP approval request.

type BetaResponseItemMcpCall struct{…}

An invocation of a tool on an MCP server.

type BetaResponseCustomToolCallItem struct{…}

A call to a custom tool created by the model.

type BetaResponseCustomToolCallOutputItem 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"
)

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

    },
  )
  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
}