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

# Embeddings

> Call /embeddings with the TypeScript SDK.

**Method**: `client.generateEmbedding()`.

### Example

```typescript theme={null}
const embedding = await client.generateEmbedding({
  model: "openai/text-embedding-3-large",
  input: "Sample text",
});
```

### Key parameters

* `model` (required): Embedding model id (e.g., `openai/text-embedding-3-large`).
* `input` (required): String or array of strings.
* `encoding_format`: `float` (default) or `base64`.
* `dimensions`: Optional integer to truncate embedding length (model-dependent).
* `user`: Optional end-user tag.

### Returns

Embedding payload (JSON)

```json theme={null}
{
  "data": [
    {
      "embedding": [0.1, 0.2, 0.3],
      "index": 0
    }
  ],
  "usage": {
    "prompt_tokens": 5,
    "total_tokens": 5
  }
}
```
