/v1/embeddingsCreate EmbeddingsGenerate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.
Request body
requiredapplication/json
Embeddings Request
Request body for creating embeddings
dimensionsintegerNumber of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-v1-0.6b, 128-2560 for pplx-embed-v1-4b. Defaults to full dimensions (1024 or 2560).
encoding_formatstringOutput encoding format for embeddings. base64_int8 returns base64-encoded signed int8 values. base64_binary returns base64-encoded packed binary (1 bit per dimension).
inputvaluerequiredInput text to embed, encoded as a string or array of strings. Maximum 512 texts per request. Each input must not exceed 32K tokens. All inputs in a single request must not exceed 120,000 tokens combined. Empty strings are not allowed.
Show child attributes
oneOf · 2 options
modelstringrequiredThe embedding model to use
{
"dimensions": 0,
"encoding_format": "base64_int8",
"input": "string",
"model": "pplx-embed-v1-0.6b"
}Responses
Embeddings Response
Response body for embeddings request
dataarray of objectList of embedding objects
Show child attributes
Show array items
A single embedding result
embeddingstringBase64-encoded embedding vector. For base64_int8: decode to signed int8 array (length = dimensions). For base64_binary: decode to packed bits (length = dimensions / 8 bytes).
indexintegerThe index of the input text this embedding corresponds to
objectstringThe object type
modelstringThe model used to generate embeddings
objectstringThe object type
usageobjectToken usage for the embeddings request
Show child attributes
costobjectCost breakdown for the request
Show child attributes
currencystringCurrency of the cost values
input_costnumberCost for input tokens in USD
total_costnumberTotal cost for the request in USD
prompt_tokensintegerNumber of tokens in the input texts
total_tokensintegerTotal number of tokens processed
{
"data": [
{
"embedding": "string",
"index": 0,
"object": "embedding"
}
],
"model": "string",
"object": "list",
"usage": {
"cost": {
"currency": "USD",
"input_cost": 0,
"total_cost": 0
},
"prompt_tokens": 0,
"total_tokens": 0
}
}HTTPValidationError
detailarray of objectShow child attributes
Show array items
locarray of valuerequiredShow child attributes
Show array items
anyOf · 2 options
msgstringrequiredtypestringrequired{
"detail": [
{
"loc": [
0
],
"msg": "string",
"type": "string"
}
]
}