# Embedding Models
[EN] Source: https://mastra.ai/models/embeddings

Mastra's model router supports embedding models using the same `provider/model` string format as language models. This provides a unified interface for both chat and embedding models with TypeScript autocomplete support.

## Quick Start

```typescript
import { ModelRouterEmbeddingModel } from "@mastra/core";
import { embedMany } from "ai";

// Create an embedding model
const embedder = new ModelRouterEmbeddingModel("openai/text-embedding-3-small");

// Generate embeddings
const { embeddings } = await embedMany({
  model: embedder,
  values: ["Hello world", "Semantic search is powerful"],
});
```

## Supported Models

### OpenAI

- `text-embedding-3-small` - 1536 dimensions, 8191 max tokens
- `text-embedding-3-large` - 3072 dimensions, 8191 max tokens
- `text-embedding-ada-002` - 1536 dimensions, 8191 max tokens

```typescript
const embedder = new ModelRouterEmbeddingModel("openai/text-embedding-3-small");
```

### Google

- `gemini-embedding-001` - 768 dimensions (recommended), 2048 max tokens
- `text-embedding-004` - 768 dimensions, 3072 max tokens

```typescript
const embedder = new ModelRouterEmbeddingModel("google/gemini-embedding-001");
```

## Authentication

The model router automatically detects API keys from environment variables:

- **OpenAI**: `OPENAI_API_KEY`
- **Google**: `GOOGLE_GENERATIVE_AI_API_KEY`

```bash