import {Meta} from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/scripts/Classes/AiZAiLite - Z.ai (Zhipu AI) Service Lite Class'/>

# AiZAiLite Class

The `AiZAiLite` class is a lightweight implementation of `AiOpenAiLite` configured for Zhipu AI (Z.ai). It overrides the client initialization to redirect all requests to Z.ai's OpenAI-compatible endpoint.

## Key Features

- **OpenAI Compatibility** — inherits all capabilities of `AiOpenAiLite` including text generation, prompt buffers, and multimodal structures.
- **Dedicated Endpoint** — automatically configures the OpenAI client with the Z.ai base URL (`https://api.z.ai/api/paas/v4`).

## Initialization

`AiZAiLite` requires manual credentials injection through the constructor.

**Constructor Parameters:**
- `key: string` — The API key for the Z.ai service.
- `model: string` — The initial model identifier (e.g., 'glm-4').

```typescript
import { AiZAiLite } from '@dxtmisha/scripts'

const ai = new AiZAiLite(process.env.ZAI_API_KEY, 'glm-4')
```

## Methods

### Internal Implementation Hooks

This class overrides the initialization hook of `AiOpenAiLite`:

- `init(): void` — Instantiates the `OpenAI` client with Z.ai's base URL and the provided key.
