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

# 多模态向量化

### 请求示例

目前仅 `doubao-embedding-vision`、`multimodal-embedding-v1`、`embed-english-v3.0`、`embed-multilingual-v3.0` 模型支持图文向量化，其他模型暂不支持。

```bash curl theme={null}
curl --location 'https://geekai.co/api/v1/embeddings' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
--data '{
    "input": [
        {
            "type": "text",
            "text": "天很蓝，海很深"
        },
        {
            "type": "image_url",
            "image_url": {
                "url": "https://ark-project.tos-cn-beijing.volces.com/images/view.jpeg"
            }
        }
    ],
    "model": "doubao-embedding-vision"
}'
```

> 注：图片支持 URL 和 Base64 编码两种格式，其中 Cohere 平台模型不支持图文混合，仅支持单独文本或图片向量化。

其中 `multimodal-embedding-v1` 除了支持图片之外，还支持视频向量化，示例如下：

```bash theme={null}
curl --location 'https://geekai.co/api/v1/embeddings' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
--data '{
    "input": [
        {
            "type": "text",
            "text": "坐在壁炉前品尝咖啡"
        },
        {
            "type": "video_url",
            "video_url": {
                "url": "https://static.geekai.co/video/new_video.mp4"
            }
        }
    ],
    "model": "multimodal-embedding-v1"
}'
```

### 格式说明

`doubao-embedding-vision` 支持的图片格式如下表：

| 图片格式     | 文件扩展名                              | 内容格式 Content Type |
| -------- | ---------------------------------- | ----------------- |
| JPEG     | .jpg, .jpeg                        | image/jpeg        |
| PNG      | .apng, .png                        | image/png         |
| GIF      | .gif                               | image/gif         |
| WEBP     | .webp                              | image/webp        |
| BMP      | .bmp                               | image/bmp         |
| TIFF     | .tiff, .tif                        | image/tiff        |
| ICO      | .ico                               | image/x-icon      |
| DIB      | .dib                               | image/bmp         |
| ICNS     | .icns                              | image/icns        |
| SGI      | .sgi                               | image/sgi         |
| JPEG2000 | .j2c, .j2k, .jp2, .jpc, .jpf, .jpx | image/jp2         |

`multimodal-embedding-v1` 支持的图片格式为 JPG、PNG、BMP，支持视频格式为 MP4、MPEG、MPG、WEBM、AVI、FLV、MKV、MOV，请自行确保提交的多模态数据格式正确。

Cohere 平台向量模型 `embed-english-v3.0`、`embed-multilingual-v3.0` 图片格式仅支持 JPG、PNG。

### 尺寸说明

`doubao-embedding-vision` 模型图片尺寸需要同时满足以下条件，否则会返回错误信息：

* 图片的宽和高的长度取值范围：\[10, 6000] px
* 图片的宽高比（即宽/高）取值范围：\[1/100, 100]

另外，`doubao-embedding-vision` 单图最大不超过 10M，`multimodal-embedding-v1` 单图最大不超过 3M，单个视频最大不超过 10M。
