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

# Gemini Embedding 001

> Gemini Embedding 001：文本向量模型。包含 MixRoute 调用示例与参数。

Gemini Embedding 001 是 Google 推出的文本向量模型。

可通过 MixRoute 的 Gemini 原生端点调用 `gemini-embedding-001`，同时支持 OpenAI 兼容端点。

## 核心能力

* Gemini embedContent - Gemini 原生向量端点
* 文本向量 - 将文本转换为数值向量
* 批量输入 - 支持字符串或字符串数组
* 相似度任务 - 可用于检索与聚类

## 快速示例

### Gemini embedContent

**cURL**

```bash theme={null}
curl "https://api.mixroute.ai/v1/models/gemini-embedding-001:embedContent" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "content": {
    "parts": [
      {
        "text": "MixRoute model API"
      }
    ]
  }
}'
```

**Python**

```python theme={null}
import requests

response = requests.post(
    "https://api.mixroute.ai/v1/models/gemini-embedding-001:embedContent",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={'content': {'parts': [{'text': 'MixRoute model API'}]}},
)

print(response.json())
```

### OpenAI 兼容 Embeddings

**cURL**

```bash theme={null}
curl "https://api.mixroute.ai/v1/embeddings" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-embedding-001",
  "input": "MixRoute model API"
}'
```

**Python**

```python theme={null}
import requests

response = requests.post(
    "https://api.mixroute.ai/v1/embeddings",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={'model': 'gemini-embedding-001', 'input': 'MixRoute model API'},
)

print(response.json())
```

## 参数

### Gemini embedContent

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `content` | object | 是 | 由 parts 组成的文本内容。 |
| `taskType` | string | 否 | 模型支持时指定向量任务类型。 |
| `outputDimensionality` | integer | 否 | 模型支持时指定输出维度。 |

### OpenAI 兼容 Embeddings

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `model` | string | 是 | 固定为 `gemini-embedding-001`。 |
| `input` | string \| array | 是 | 需要向量化的文本。 |
| `dimensions` | integer | 否 | 模型支持时指定输出维度。 |


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