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

# 向量生成

> 文本向量生成接口。

## 用途

用于把文本转换为向量，适合检索、召回和语义相似度场景。

## 请求头

<ParamField header="Authorization" type="string" default="Bearer YOUR_API_KEY" required>
  Bearer 鉴权请求头。
</ParamField>

## 请求体

<ParamField body="model" type="string" default="text-embedding-3-small" required>
  向量模型名称。
</ParamField>

<ParamField body="input" type="string" default="HubTo 是统一的大模型接口网关。" required>
  待向量化文本。
</ParamField>

<ParamField body="encoding_format" type="string" default="float">
  可选，向量编码格式。
</ParamField>

## 示例请求体

```json theme={null}
{
  "model": "text-embedding-3-small",
  "input": "HubTo 是统一的大模型接口网关。"
}
```

## 响应

<ResponseField name="data" type="object[]">
  向量结果数组，通常位于 `data[0].embedding`。
</ResponseField>
