> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Einbettungen

> Rufe /embeddings mit dem PHP-SDK auf.

**Methoden**: `$client->generateEmbedding(...)` oder `$client->createEmbedding(...)`

### Beispiel

```php theme={null}
<?php

require 'vendor/autoload.php';

use Phaseo\Sdk\Phaseo;

$client = new Phaseo(getenv('PHASEO_API_KEY'));
$response = $client->generateEmbedding([
    'model' => 'openai/text-embedding-3-large',
    'input' => 'Sample text',
]);

echo $response['data'][0]['embedding'][0] ?? '';
```

### Wichtige Parameter

* `model` (erforderlich): ID des Embedding-Modells (z. B. `openai/text-embedding-3-large`).
* `input` (erforderlich): eine Zeichenfolge oder ein Array aus Zeichenfolgen.
* `encoding_format`: `float` (Standard) oder `base64`.
* `dimensions`: optionale Ganzzahl zum Kürzen der Embedding-Länge (modellabhängig).
* `user`: optionales Endnutzer-Tag.

### Rückgabewert

Embedding-Payload (JSON)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.