> ## Documentation Index
> Fetch the complete documentation index at: https://cognitio-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AssistantMessage

> Exact type definition referenced by the public SDK.

This definition is generated from the same source as the SDK. Protocol types describe the runtime HTTP API; prefer the high-level SDK for session ownership and callbacks.

```ts theme={null}
export type AssistantMessage = {
  id: string
  sessionID: string
  role: "assistant"
  time: {
    created: number
    completed?: number
  }
  error?:
    | ProviderAuthError
    | UnknownError
    | MessageOutputLengthError
    | MessageAbortedError
    | StructuredOutputError
    | ContextOverflowError
    | ApiError
  parentID: string
  parentMessageID?: string
  modelID: string
  providerID: string
  mode: string
  agent: string
  path: {
    cwd: string
    root: string
  }
  summary?: boolean
  cost: number
  tokens: {
    total?: number
    input: number
    output: number
    reasoning: number
    cache: {
      read: number
      write: number
    }
  }
  structured?: unknown
  variant?: string
  finish?: string
}
```

Related types: [ApiError](https://cognitio-agent.mintlify.site/api-reference/protocol/ApiError.md), [ContextOverflowError](https://cognitio-agent.mintlify.site/api-reference/protocol/ContextOverflowError.md), [MessageAbortedError](https://cognitio-agent.mintlify.site/api-reference/protocol/MessageAbortedError.md), [MessageOutputLengthError](https://cognitio-agent.mintlify.site/api-reference/protocol/MessageOutputLengthError.md), [ProviderAuthError](https://cognitio-agent.mintlify.site/api-reference/protocol/ProviderAuthError.md), [StructuredOutputError](https://cognitio-agent.mintlify.site/api-reference/protocol/StructuredOutputError.md), [UnknownError](https://cognitio-agent.mintlify.site/api-reference/protocol/UnknownError.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.