Open History to see the last commit
1---
2id: UIMessage
3title: UIMessage
4---
5
6# Interface: UIMessage
7
8Defined in: [types.ts:284](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L284)
9
10UIMessage - Domain-specific message format optimized for building chat UIs
11Contains parts that can be text, tool calls, or tool results
12
13## Properties
14
15### createdAt?
16
17```ts
18optional createdAt: Date;
19```
20
21Defined in: [types.ts:288](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L288)
22
23***
24
25### id
26
27```ts
28id: string;
29```
30
31Defined in: [types.ts:285](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L285)
32
33***
34
35### parts
36
37```ts
38parts: MessagePart[];
39```
40
41Defined in: [types.ts:287](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L287)
42
43***
44
45### role
46
47```ts
48role: "user" | "assistant" | "system";
49```
50
51Defined in: [types.ts:286](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L286)