# BoundedChatTransport



# Overview

A custom chat transport that sends only recent messages since the last summary, keeping the context window bounded. It pairs with [AskAI](/docs/api-reference/client/ask-ai) via the `chatTransport` prop.

## Type Definition

```ts
import type { UIMessage } from 'ai';
import { DefaultChatTransport } from 'ai';

export interface BoundedChatTransportOptions {
  endpoint: string;
}

export declare class BoundedChatTransport extends DefaultChatTransport<UIMessage> {
  constructor(options: BoundedChatTransportOptions);
}
```

## Usage

```tsx
import { AskAI, BoundedChatTransport } from 'peam/client';

export default function Page() {
  return (
    <AskAI
      chatTransport={
        new BoundedChatTransport({
          endpoint: '/api/peam',
        })
      }
    />
  );
}
```

## Notes

* This is the default transport used by [AskAI](/docs/api-reference/client/ask-ai) when `chatTransport` is not provided.
* It reads the summary markers in the request body to limit the message window.


## Sitemap
[Overview of all docs pages](/sitemap.md)
