Skip to main content
POST
/api/v1/embeddings
input 必须是字符串或字符串数组。token ID 数组会被拒绝并返回 HTTP 400。LangChain OpenAIEmbeddings 必须设置 check_embedding_ctx_length=False

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求头

Accept-Encoding
string

Supported compression encodings (gzip, br)

示例:

"gzip, br"

请求体

application/json

Create embeddings for the supplied input.

input
必填

Input text to embed, encoded as a string or array of strings. To embed multiple inputs in a single request, pass an array of strings. The input must not exceed the max input tokens for the model (8192 tokens), cannot be an empty string, and any array must contain 2048 items or less. Token arrays are not supported and return HTTP 400. LangChain OpenAIEmbeddings sends token arrays unless you set check_embedding_ctx_length=False.

Minimum string length: 1
示例:

"The quick brown fox jumped over the lazy dog"

model
必填

ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.

示例:

"text-embedding-bge-m3"

dimensions
integer

The number of dimensions the resulting output embeddings should have.

必填范围: x >= 1
encoding_format
enum<string>
默认值:float

The format to return the embeddings in. Can be either float or base64.

可用选项:
float,
base64
示例:

"float"

user
string

This is an unused parameter and is discarded by Venice. It is supported solely for API compatibility with OpenAI.

响应

OK

data
object[]
必填

The list of embeddings generated by the model.

model
string
必填

The name of the model used to generate the embedding.

object
enum<string>
必填

The object type, which is always "list"

可用选项:
list
usage
object
必填

The usage information for the request.