# AI

Token counts, token usage and the messages of a chat with a model.

## Topics

| Page | What it covers |
|---|---|
| [AI types](/docs/ai-types.md) | The AI types are the values an app passes to and from a model: chat messages and their roles, vectors and embeddings, and token counts. |

## Types

| Type | What it is |
|---|---|
| [`TokenCount`](/docs/types/type-token-count.md) | How many tokens a prompt or an answer holds, by its model's own count. |
| [`TokenUsage`](/docs/types/type-token-usage.md) | The tokens one call to a model used: what it read, what it wrote and what its cache served. |
| [`ChatMessage`](/docs/types/type-chat-message.md) | One message in a conversation with an AI model: who wrote it and what it says. |
| [`ChatRole`](/docs/types/type-chat-role.md) | Who wrote a message in a conversation with a model: `system`, `user`, `assistant` or `tool`. |
