> ## 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.

# Text Embedding Ada 002

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

Text Embedding Ada 002 是 OpenAI 推出的文本向量模型。

可使用下方端点通过 MixRoute 调用 `text-embedding-ada-002`。

## 核心能力

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

## 快速示例

<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": "text-embedding-ada-002",
      "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': 'text-embedding-ada-002', 'input': 'MixRoute model API'},
    )

    print(response.json())
    ```
  </Tab>
</Tabs>

## 参数

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `model` | string | 是 | 固定为 `text-embedding-ada-002`。 |
| `input` | string \| array | 是 | 需要向量化的文本或文本数组。 |
| `dimensions` | integer | 否 | 模型支持时指定输出维度。 |
| `encoding_format` | string | 否 | 向量编码格式。 |


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