Create Embeddings
POST/v1/embeddings
Authorization
Authorizationstringrequired
Bearer token for API authentication. Format: `Bearer YOUR_API_KEY`
Request Body
modelstringrequired
The model to use for creating embeddings.
Constraints
•Minimum length: 1•Maximum length: 500
inputstring | arrayrequired
Input
Constraints
•Minimum length: 1•Maximum length: 64000•Minimum items: 1•Maximum items: 256
dimensionsinteger
The number of dimensions to use for the embeddings.
Constraints
•Exclusive minimum: 0
promptstring
The prompt to use for the embedding creation.
Constraints
•Minimum length: 1•Maximum length: 32000
normalizedbooleandefault:
trueWhether to normalize the embeddings.
encoding_formatEncodingFormat | EncodingFormat[]default:
floatThe encoding format(s) of the embeddings. Can be a single format or a list of formats.
Response Body
modelstringrequired
The model used
dataEmbedding[] | MultiEncodingEmbedding[]required
The created embeddings.
objectstringdefault:
listThe object type of the response
normalizedbooleanrequired
Whether the embeddings are normalized.
encoding_formatEncodingFormat | EncodingFormat[]required
The encoding formats of the embeddings.
dimensionsintegerrequired
The number of dimensions used for the embeddings.
Request
POST/v1/embeddings
from mixedbread import Mixedbread
mxbai = Mixedbread(api_key="YOUR_API_KEY")
response = mxbai.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
input=[
"Who is German and likes bread?",
"Everybody in Germany.",
],
normalized=True,
encoding_format="float",
)
print(response.data[0].embedding)Response
JSON
{
"model": "mixedbread-ai/mxbai-embed-large-v1",
"normalized": true,
"encoding_format": "float",
"object": "list",
"data": [
{
"embedding": [0.1, 0.2, 0.3],
"index": 0
},
{
"embedding": [0.4, 0.5, 0.6],
"index": 1
}
],
"usage": {
"prompt_tokens": 12,
"total_tokens": 12
}
}Last updated: January 7, 2026