---
title: "API reference"
manual: "AI Universe"
version: "1.0"
permalink: "https://docs.typo3.org/permalink/nitsan/ns-aiuniverse:api-reference@1.0"
source: "Api/Index.rst"
rendered: "2026-10-19T14:06:07+00:00"
---

# API reference {#api-reference}

Reference for major public classes used by dependent extensions.

-   [AiRequestService](https://docs.typo3.org/permalink/nitsan/ns-aiuniverse:airequestservice@1.0)
-   [BaseClient](https://docs.typo3.org/permalink/nitsan/ns-aiuniverse:baseclient@1.0)
-   [AiStatisticsService](https://docs.typo3.org/permalink/nitsan/ns-aiuniverse:aistatisticsservice@1.0)
-   [AiEngineConfiguration](https://docs.typo3.org/permalink/nitsan/ns-aiuniverse:aiengineconfiguration@1.0)
-   [HttpAuthUtility](https://docs.typo3.org/permalink/nitsan/ns-aiuniverse:httpauthutility@1.0)
-   [AiUniverseUtilityHelper](https://docs.typo3.org/permalink/nitsan/ns-aiuniverse:aiuniverseutilityhelper@1.0)

## AiRequestService {#airequestservice}

-   **Namespace:**

    `NITSANNsAiUniverseServiceAiRequestService`

Key method:

**Main request API**

```php
public function sendRequest(
    string $modelType,
    array $messages,
    string $aiSelectedModel = '',
    array $options = [],
    bool $logRequest = true,
    string $module = '',
    string $scope = ''
): string
```

## BaseClient {#baseclient}

-   **Namespace:**

    `NITSANNsAiUniverseClientBaseClient`

Important methods:

-   `getRequestData()`
-   `getResponseData()`
-   `getStreamRequestData()`
-   `getStreamChunkText()`
-   `getEmbeddingRequestData()`
-   `parseEmbeddingResponse()`
-   `getOpenAiUsageData()`

## AiStatisticsService {#aistatisticsservice}

-   **Namespace:**

    `NITSANNsAiUniverseServiceAiStatisticsService`

Main method:

-   `getOpenAiStatistics(string $date = '', int $dateScope = 0, bool $forceRefresh = false): array`

## AiEngineConfiguration {#aiengineconfiguration}

-   **Namespace:**

    `NITSANNsAiUniverseConfigurationAiEngineConfiguration`

Main methods:

-   `getTextGenerationAIEngines(bool $ignoreConfig = false): array`
-   `getAllAIEngines(bool $ignoreConfig = false): array`

## HttpAuthUtility {#httpauthutility}

-   **Namespace:**

    `NITSANNsAiUniverseUtilityHttpAuthUtility`

Main methods:

-   `fetchContentFromUrl(string $url): string`
-   `addAuthHeader(ServerRequestInterface $request): ServerRequestInterface`
-   `isBasicAuthEnabled(): bool`

## AiUniverseUtilityHelper {#aiuniverseutilityhelper}

-   **Namespace:**

    `NITSANNsAiUniverseUtilityAiUniverseUtilityHelper`

Main methods:

-   `getExtensionConf(string $extensionKey = 'ns_aiuniverse'): array`
-   `setExtensionConf(array $value, string $extensionKey = 'ns_aiuniverse'): void`
-   `isApiKeySet(string $extensionKey = 'ns_aiuniverse', string $apiKeyName = 'openai_api_key'): bool`
