import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.responses.listInputItems({
responseId: "resp_abc123",
after: "item_abc123",
include: [
"file_search_call.results",
],
limit: 50,
order: "asc",
});
console.log(result);
}
run();{
"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
}Retrieves a paginated list of all input items provided when creating the specified agent response.
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.responses.listInputItems({
responseId: "resp_abc123",
after: "item_abc123",
include: [
"file_search_call.results",
],
limit: 50,
order: "asc",
});
console.log(result);
}
run();{
"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
}Authenticate with your MKA1 API key at the API gateway: Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, also send X-On-Behalf-Of to identify the end user making the request.
Optional external user identifier for multi-user server-side integrations. Use this when acting on behalf of one of your end users.
The unique identifier of the response, formatted as 'resp_' or 'resp-' followed by alphanumeric characters.
^resp[-_][a-zA-Z0-9]+$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.
"item_abc123"
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.
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 ["file_search_call.results"]The maximum number of input items to return per page. Must be between 1 and 100. Defaults to 20 items.
1 <= x <= 10050
The order to return the input items in. 'asc' returns oldest items first, 'desc' returns newest items first. Defaults to 'desc' (newest first).
asc, desc "asc"
Paginated list of input items for the specified response.
Paginated list object containing input items for a response with cursor-based pagination metadata.
The object type, always 'list' for paginated list responses.
Array of input items (messages, prompts, instructions) that were provided when creating the response. Each item contains its type, content, role, and metadata.
A message input item with a role and content. Represents a single turn in the conversation from a user, assistant, system, or developer.
Show child attributes
Indicates whether there are more items available beyond the current page. True if additional pages exist, false otherwise.
The ID of the first item in the current page. Used as a reference point for pagination.
The ID of the last item in the current page. Used as a cursor for fetching the next page.
Was this page helpful?