API Reference

Items & Events

Complete reference for all item shapes and streaming events, aligned with the OpenResponses specification.

Open Responses Compliance

Noetic's output item types are direct type aliases of the @openrouter/sdk types (e.g., ResponsesOutputMessage, ResponsesOutputItemFunctionCall). There is no hand-rolled ItemBase or conversion layer -- the SDK types provide id, type, and status fields natively.

This means:

  • Any Open Responses-compatible client can consume Noetic's item log directly.
  • Items round-trip cleanly: output items from the SDK are used as-is; framework items (InputMessageItem, FunctionCallOutputItem) follow the same shape conventions.
  • The type discriminant on every item matches the Open Responses type field exactly.

Content Parts

Content part types used within message and reasoning items.

OutputTextPart

Model-generated text content with optional annotations and logprobs. Type alias for ResponseOutputText from @openrouter/sdk.

type OutputTextPart = ResponseOutputText;
// { type: 'output_text'; text: string; annotations?: ...; logprobs?: ... }

RefusalPart

Model refusal content. Type alias for OpenAIResponsesRefusalContent from @openrouter/sdk.

type RefusalPart = OpenAIResponsesRefusalContent;
// { type: 'refusal'; refusal: string }

InputTextPart

User/developer input text, created by the framework (not from the SDK).

interface InputTextPart {
  readonly type: 'input_text';
  readonly text: string;
}

ReasoningTextPart

Reasoning trace content within ReasoningItem. Type alias for ReasoningTextContent from @openrouter/sdk.

type ReasoningTextPart = ReasoningTextContent;
// { type: 'reasoning_text'; text: string }

SummaryTextPart

Reasoning summary content within ReasoningItem. Type alias for ReasoningSummaryText from @openrouter/sdk.

type SummaryTextPart = ReasoningSummaryText;
// { type: 'summary_text'; text: string }

ContentPart

Union of content parts used in message items:

type ContentPart = OutputTextPart | RefusalPart | InputTextPart;
VariantFieldsDescription
output_texttext: stringText generated by the model
input_texttext: stringText provided by the user or system
refusalrefusal: stringModel refusal message

Output Items (from the model)

These are type aliases of the @openrouter/sdk types. The SDK provides id, type, and status fields on each item.

MessageItem

Assistant message output item. Type alias for ResponsesOutputMessage.

type MessageItem = ResponsesOutputMessage;
FieldTypeDescription
type'message'Discriminant
role'assistant'Always assistant for output messages
contentContentPart[]Message content segments

FunctionCallItem

A tool/function invocation requested by the model. Type alias for ResponsesOutputItemFunctionCall.

type FunctionCallItem = ResponsesOutputItemFunctionCall;
FieldTypeDescription
type'function_call'Discriminant
callIdstringUnique call identifier, used to match with the output
namestringFunction name
argumentsstringJSON-encoded arguments

ReasoningItem

Internal reasoning trace emitted by reasoning-capable models. Type alias for ResponsesOutputItemReasoning. Uses ReasoningTextPart and SummaryTextPart content types (not OutputTextPart).

type ReasoningItem = ResponsesOutputItemReasoning;
FieldTypeDescription
type'reasoning'Discriminant
contentReasoningTextPart[]Reasoning text content (reasoning_text type)
summarySummaryTextPart[]Summary of the reasoning (summary_text type)
encryptedContentstringOptional encrypted reasoning (provider-specific)

WebSearchItem

Web search call result. Type alias for ResponsesWebSearchCallOutput.

type WebSearchItem = ResponsesWebSearchCallOutput;
FieldTypeDescription
type'web_search_call'Discriminant
idstringUnique item identifier
actionActionThe search action: search, open_page, or find_in_page
statusstringLifecycle status

FileSearchItem

File search call result. Type alias for ResponsesOutputItemFileSearchCall.

type FileSearchItem = ResponsesOutputItemFileSearchCall;
FieldTypeDescription
type'file_search_call'Discriminant
idstringUnique item identifier
queriesstring[]Search queries
statusstringLifecycle status

ImageGenerationItem

Image generation call result. Type alias for ResponsesImageGenerationCall.

type ImageGenerationItem = ResponsesImageGenerationCall;
FieldTypeDescription
type'image_generation_call'Discriminant
idstringUnique item identifier
resultstring | nullGenerated image data
statusstringLifecycle status

ServerToolItem

Server tool output with a vendor-prefixed type (e.g., openrouter:datetime). Based on ResponsesServerToolOutput with the type field constrained to ${string}:${string} for discriminant narrowing.

type ServerToolItem = Omit<ResponsesServerToolOutput, 'type'> & {
  readonly type: `${string}:${string}`;
};
FieldTypeDescription
type`${string}:${string}`Namespaced type. The prefix identifies the vendor or domain, the name identifies the item kind.

The prefix identifies the vendor or domain (e.g., openrouter, noetic, myapp) and the name identifies the specific item kind. None of the standard item types contain a colon, so the presence of : in the type string cleanly distinguishes server tool outputs from standard items.

OutputItem Union

All output item types from the model:

type OutputItem =
  | MessageItem
  | FunctionCallItem
  | ReasoningItem
  | WebSearchItem
  | FileSearchItem
  | ImageGenerationItem
  | ServerToolItem;

Framework Items (created by Noetic)

These item types are Noetic-owned interfaces for items created by the framework, not the model.

InputMessageItem

Input message created by the framework for user, system, or developer roles.

interface InputMessageItem {
  readonly id: string;
  readonly type: 'message';
  readonly role: 'user' | 'system' | 'developer';
  readonly status: 'in_progress' | 'completed' | 'incomplete' | 'failed';
  readonly content: InputTextPart[];
}
FieldTypeDescription
type'message'Discriminant
role'user' | 'system' | 'developer'Message author. developer is used for framework-injected context (e.g., from memory layers), distinct from system (agent instructions).
contentInputTextPart[]Input text content segments
statusstringLifecycle status. Includes failed as a Noetic extension beyond the Open Responses spec.

FunctionCallOutputItem

Tool execution output created by the harness during the tool loop. This is an input-only item type in Open Responses (sent by the developer, not the model).

interface FunctionCallOutputItem {
  readonly id: string;
  readonly type: 'function_call_output';
  readonly status: 'in_progress' | 'completed' | 'incomplete' | 'failed';
  readonly callId: string;
  readonly output: string;
}
FieldTypeDescription
type'function_call_output'Discriminant
callIdstringMatches the callId from the corresponding FunctionCallItem
outputstringJSON-encoded tool output
statusstringLifecycle status. Includes failed as a Noetic extension.

Item Union

All item types that can appear in an ItemLog:

type Item = OutputItem | InputMessageItem | FunctionCallOutputItem;

Streaming Events

When using the OpenResponses streaming API, the server emits a sequence of typed events. Each event has a type field using a dot-separated hierarchy and a sequenceNumber for ordering.

Response Lifecycle (Standard)

These events bracket the entire response.

EventDescriptionKey Payload
response.createdResponse object initializedresponse
response.in_progressGeneration has startedresponse
response.completedSuccessful completionresponse
response.incompleteTruncated (e.g., max tokens)response
response.failedError occurredresponse

Output Items (Standard)

Emitted as output items are added and completed.

EventDescriptionKey Payload
response.output_item.addedNew output item starteditem, outputIndex
response.output_item.doneOutput item completeitem, outputIndex

Content Parts (Standard)

Emitted as content parts within an output item are added and completed.

EventDescriptionKey Payload
response.content_part.addedNew content part startedpart, outputIndex, contentIndex
response.content_part.doneContent part completepart, outputIndex, contentIndex

Text Streaming (Standard)

Delta events for streaming text output.

EventDescriptionKey Payload
response.output_text.deltaText chunk receiveddelta, logprobs
response.output_text.doneText generation completetext, logprobs
response.output_text.annotation.addedAnnotation added to textannotation

Refusal (Standard)

Delta events when the model refuses a request.

EventDescriptionKey Payload
response.refusal.deltaRefusal chunkdelta
response.refusal.doneRefusal completerefusal

Function Call Arguments (Standard)

Delta events for streaming function call arguments.

EventDescriptionKey Payload
response.function_call_arguments.deltaArgument chunkdelta, name
response.function_call_arguments.doneArguments completearguments, name

Reasoning (Standard)

Delta events for reasoning model output (e.g., o1, o3).

EventDescriptionKey Payload
response.reasoning.deltaReasoning chunkdelta
response.reasoning.doneReasoning completetext
response.reasoning_summary_part.addedSummary part startedpart
response.reasoning_summary_part.doneSummary part completepart
response.reasoning_summary_text.deltaSummary text chunkdelta
response.reasoning_summary_text.doneSummary text completetext

Web Search Events (Built-in Extension)

Emitted when the model uses the built-in web search capability. These are officially part of the OpenResponses specification.

EventDescription
response.web_search_call.in_progressSearch started
response.web_search_call.searchingActively searching
response.web_search_call.completedSearch results ready

Image Generation Events (Built-in Extension)

Emitted when the model uses the built-in image generation capability. These are officially part of the OpenResponses specification.

EventDescription
response.image_gen_call.in_progressGeneration started
response.image_gen_call.generatingActively generating
response.image_gen_call.partial_imagePartial result available
response.image_gen_call.completedImage ready

How Items Flow in Noetic

Noetic's adapter layer bridges the framework's Item types and the OpenResponses wire format. Here is the lifecycle of items through a single LLM call:

┌─────────────────────────────────────────────────┐
│  ItemLog                                        │
│  ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│  │ message  │ │ fn_call  │ │ fn_call_output   │ │
│  │ (user)   │ │          │ │                  │ │
│  └──────────┘ └──────────┘ └──────────────────┘ │
└────────────────────┬────────────────────────────┘

            extractSystemInstruction()
            itemsToInput()


         ┌───────────────────────┐
         │  OpenRouter SDK       │
         │  callModel()          │
         └───────────┬───────────┘

            responseToNoeticItems()
            extractUsage()


┌─────────────────────────────────────────────────┐
│  ItemLog (updated)                              │
│  ... + ┌──────────┐ ┌──────────────────┐        │
│        │ message  │ │ function_call    │        │
│        │ (asst)   │ │ (if tools used)  │        │
│        └──────────┘ └──────────────────┘        │
└─────────────────────────────────────────────────┘
  1. Items in → SDK input: extractSystemInstruction() pulls system messages out as the instructions parameter. itemsToInput() converts remaining Noetic Items into the OpenResponses input format.
  2. SDK calls model: The OpenRouter SDK sends the request and handles the response.
  3. SDK response → Items out: responseToNoeticItems() converts output items back to Noetic Items. extractUsage() pulls token counts and cost.
  4. Items appended: New items are appended to the ItemLog. The Projector reads the full ItemLog when assembling the View for the next LLM call.

Server tool items and reasoning items are skipped during input conversion (they are internal metadata). The adapter converts all output item types (message, function_call, reasoning, web_search_call, file_search_call, image_generation_call, and server tool outputs) into their corresponding Noetic Item variants.

Framework Events

In addition to OpenResponses streaming events, Noetic emits framework-level events during execution. These events use the harness config.name as a prefix and have source: 'framework'.

EventDescriptionKey Payload
{name}:step_startedBefore each step executesstepId, kind
{name}:step_completedAfter each step completesstepId, kind
{name}:tool_round_startedBefore a tool execution roundround, toolCount
{name}:tool_call_startedBefore each tool callname, callId
{name}:tool_call_completedAfter each tool callname, callId, error
{name}:tool_round_completedAfter all tool calls in a roundround, toolCount

Framework events are available through harness.execute(input).getFullStream() alongside SDK events. They can be distinguished by the source field:

for await (const event of harness.execute('Hello').getFullStream()) {
  if (event.source === 'sdk') {
    // OpenResponses SSE event
  }
  if (event.source === 'framework') {
    // Noetic lifecycle event, e.g. 'myagent:step_started'
  }
}

On this page