# AIChatServiceOptions Class

Configuration options for the [AIChatService](https://blazor.radzen.com/docs/api/Radzen.AIChatService.md).

Namespace: [Radzen](https://blazor.radzen.com/docs/api/Radzen.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- AIChatServiceOptions

## Syntax

```csharp
public class AIChatServiceOptions
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public AIChatServiceOptions()` | Configuration options for the [AIChatService](https://blazor.radzen.com/docs/api/Radzen.AIChatService.md). |

## Properties

| Property | Type | Description |
|------|------|-------------|
| ApiKey | `string` | Gets or sets the API key sent with the ApiKeyHeader header. Server-side only: configure it in Blazor Server or in the server that hosts a WebAssembly application and forwards the requests of Proxy. A key configured in the browser is visible to every user, so the service throws when a WebAssembly application sets one. |
| ApiKeyHeader | `string` | Gets or sets the header name for the API key (e.g., 'Authorization' or 'api-key'). |
| EmbeddingsEndpoint | `string` | Gets or sets the embeddings endpoint URL. When not set it is derived from Endpoint by replacing chat/completions with embeddings. |
| EmbeddingsModel | `string` | Gets or sets the embeddings model name (e.g., 'text-embedding-3-small'). |
| EmbeddingsProxy | `string` | Gets or sets the proxy URL for embeddings requests, if any. When not set and Proxy is set it is derived from it by replacing chat/completions with embeddings. |
| Endpoint | `string` | Gets or sets the endpoint URL for the AI service. |
| MaxMessages | `int` | Gets or sets the maximum number of messages to keep in conversation memory. |
| MaxTokens | `int?` | Gets or sets the maximum number of tokens to generate in the response. |
| Model | `string` | Gets or sets the model name to use for executing chat completions (e.g., 'gpt-3.5-turbo'). |
| Proxy | `string` | Gets or sets the proxy URL for the AI service, if any. If set, this will override the Endpoint. |
| SessionMaxAgeHours | `int` | Gets or sets the maximum age in hours for conversation sessions before cleanup. |
| SystemPrompt | `string` | Gets or sets the system prompt for the AI assistant. |
| Temperature | `double` | Gets or sets the temperature for the AI model (0.0 to 2.0). Set to 0.0 for deterministic responses, higher values for more creative outputs. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `GetEmbeddingsEndpoint()` | `string` | Gets the effective embeddings endpoint: EmbeddingsEndpoint or the one derived from Endpoint. |
| `GetEmbeddingsProxy()` | `string` | Gets the effective embeddings proxy: EmbeddingsProxy or the one derived from Proxy, or null. |

