Skip to main content
GET
/
api
/
v1
/
llm
/
responses
/
{response_id}
/
input_items
Python (SDK)
from mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.llm.responses.list_input_items(response_id="resp_abc123", after="item_abc123", include=[
        "file_search_call.results",
    ], limit=50, order="asc")

    # Handle response
    print(res)
{
  "object": "list",
  "data": [
    {
      "type": "message",
      "id": "msg_user_abc123",
      "role": "user",
      "content": "What is the capital of France?"
    }
  ],
  "first_id": "msg_user_abc123",
  "last_id": "msg_user_abc123",
  "has_more": false
}

Authorizations

Authorization
string
header
required

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Path Parameters

response_id
string
required

The unique identifier of the response, formatted as 'resp_' or 'resp-' followed by alphanumeric characters.

Pattern: ^resp[-_][a-zA-Z0-9]+$

Query Parameters

after
string

An item ID to use as a cursor for pagination. Returns items that come after this ID in the list. Used for cursor-based pagination to fetch subsequent pages.

Example:

"item_abc123"

include
enum<string>[]

Additional fields to include in the input items. Allows requesting specific nested data like web search sources, code interpreter outputs, computer screenshots, file search results, input images, output logprobs, or reasoning content. These fields may have performance or cost implications.

Available options:
web_search_call.action.sources,
code_interpreter_call.outputs,
computer_call_output.output.image_url,
file_search_call.results,
message.input_image.image_url,
message.output_text.logprobs,
reasoning.encrypted_content
Example:
["file_search_call.results"]
limit
integer
default:20

The maximum number of input items to return per page. Must be between 1 and 100. Defaults to 20 items.

Required range: 1 <= x <= 100
Example:

50

order
enum<string>

The order to return the input items in. 'asc' returns oldest items first, 'desc' returns newest items first. Defaults to 'desc' (newest first).

Available options:
asc,
desc
Example:

"asc"

Response

200 - application/json

Paginated list of input items for the specified response.

Paginated list object containing input items for a response with cursor-based pagination metadata.

object
any
required

The object type, always 'list' for paginated list responses.

data
(Input message item · object | Output message item · object | Output audio item · object | File search call item · object | Computer call item · object | Computer call output item · object | Web search call item · object | Function call item · object | Function call output item · object | Reasoning item · object | Image generation call item · object | Code interpreter call item · object | Local shell call item · object | Local shell call output item · object | Shell call item · object | Shell call output item · object | MCP list tools item · object | MCP approval request item · object | MCP approval response item · object | MCP call item · object | Custom tool call item · object | Custom tool call output item · object | Item reference item · object | Compaction item · object)[]
required

Array of input items (messages, prompts, instructions) that were provided when creating the response. Each item contains its type, content, role, and metadata.

Input message item: A message with role and content. Use this for user, assistant, system, or developer turns in structured inputs.

has_more
boolean
required

Indicates whether there are more items available beyond the current page. True if additional pages exist, false otherwise.

first_id
string

The ID of the first item in the current page. Used as a reference point for pagination.

last_id
string

The ID of the last item in the current page. Used as a cursor for fetching the next page.