> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixroute.ai/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

<Tabs>
  <Tab title="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"
          }
        ]
      }
    }'
    ```
  </Tab>

  <Tab title="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())
    ```
  </Tab>
</Tabs>

### OpenAI 相容 Embeddings

<Tabs>
  <Tab title="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"
    }'
    ```
  </Tab>

  <Tab title="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())
    ```
  </Tab>
</Tabs>

## 參數

### Gemini embedContent

| 參數                     | 類型      | 必填 | 說明               |
| ---------------------- | ------- | -- | ---------------- |
| `content`              | object  | 是  | 由 parts 組成的文字內容。 |
| `taskType`             | string  | 否  | 模型支援時指定向量任務類型。   |
| `outputDimensionality` | integer | 否  | 模型支援時指定輸出維度。     |

### OpenAI 相容 Embeddings

| 參數           | 類型              | 必填 | 說明                          |
| ------------ | --------------- | -- | --------------------------- |
| `model`      | string          | 是  | 固定為 `gemini-embedding-001`。 |
| `input`      | string \| array | 是  | 需要向量化的文字。                   |
| `dimensions` | integer         | 否  | 模型支援時指定輸出維度。                |
