---
title: "Create Embeddings"
method: POST
path: "/embeddings"
tags: ["Embeddings"]
---

# Create Embeddings

`POST /embeddings`

Creates an embedding vector representing the input text.

## Request body

- EmbeddingsRequest
  - `model` 'BAAI/bge-large-zh-v1.5' | 'BAAI/bge-large-en-v1.5' | 'netease-youdao/bce-embedding-base_v1' | 'BAAI/bge-m3' | 'Pro/BAAI/bge-m3', required — The name of the embedding model to use.要使用的 embedding 模型名称。
  - `input` union, required — Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (512 tokens for all models except BAAI/bge-m3 which is 8192), cannot be an empty string. 输入的文本将被编码为字符串或 tokens 数组。要在单个请求中嵌入多个输入，请传递字符串数组或字符串数组。每个字符串不得超过模型的最大 tokens 限制（BAAI/bge-m3模型为8192tokens，其余模型为512tokens），且不能为空字符串。
    - string — The string that will be turned into an embedding. the item must not exceed the max models tokens limitation. 将字符串数组转换为嵌入，string 长度不得超过模型的最大 tokens 限制。当前输入长度不得超过当前模型的 512 个 tokens。
    - string[] — The array of strings that will be turned into an embedding. The array length must not exceed the max size, and the item must not exceed the max models tokens limitation. Current, the maximum array size is 32 , At the same time every item must not exceed 512 tokens for current models. 将字符串数组转换为嵌入。数组长度不得超过最大限制，且每项不得超过模型的最大 tokens 限制。目前，最大数组大小为 32，同时每项不得超过当前模型的 512 个 tokens。
  - `encoding_format` 'float' | 'base64' — "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). 返回嵌入的格式。可以是 float 或 [`base64`](https://pypi.org/project/pybase64/)."

## Response `200`

200

- EmbeddingsResponse
  - `object` string, required — The object type, which is always "list".
  - `model` string, required — The name of the model used to generate the embedding.
  - `data` object[], required — The list of embeddings generated by the model.
    - `object` 'embedding', required
    - `embedding` number[], required
    - `index` integer, required
  - `usage` object, required — The usage information for the request.
    - `prompt_tokens` integer, required — The number of tokens used by the prompt.
    - `completion_tokens` integer, required — The number of tokens used by the completion.
    - `total_tokens` integer, required — The total number of tokens used by the request.

## Other responses

- `400` — BadRequest
- `401` — Unauthorized
- `404` — NotFound
- `429` — RateLimit
- `503` — Overloaded
- `504` — Timeout

---

[API](https://skmtc.dev/siliconflow/apis/siliconflow-api.md) · [All operations](https://skmtc.dev/siliconflow/apis/siliconflow-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/siliconflow/siliconflow-api/revisions/945a814800c3/schema)
