Create embeddings
OpenAI-compatible embeddings. Batch up to 2048 inputs per call.
model is required. input is a string or a list of strings;
multimodal embedding models also take a list of text, image, and
video parts, such as {"type": "image", "url": "https://..."}.
Token IDs return 400 with param set to input.
encoding_format: "base64" works on every embedding model and
returns each vector as a base64 string of little-endian 32-bit
floats. dimensions sets the vector size on models that offer more
than one size; a model with a fixed size returns 400 for any other
value.
On models that offer them (see the model page), output_type
returns sparse vectors: sparse returns token weights in
sparse_embedding with an empty embedding, and dense_and_sparse
returns both. instruct takes an instruction describing the search
task when you embed search queries; its tokens bill as input.
Authentication
Pass your EmpirioLabs API key as a bearer token. The Anthropic-style
x-api-key header is also accepted on every endpoint.
Request
Embedding model id, for example text-embedding-v4.
Text to embed, or an array of texts. Multimodal embedding models also take an array of text, image, and video parts. Token IDs return 400.
Vector encoding: float arrays or base64 strings of little-endian 32-bit floats. Both work on every embedding model.
Vector size, on models that offer more than one. A model with a fixed size returns 400 for any other value. See the model page for the sizes it offers.
On models that offer sparse vectors: dense returns the vector in embedding, sparse returns token weights in sparse_embedding with an empty embedding, and dense_and_sparse returns both. Every output type bills the same tokens.
On models that take one: an instruction describing the search task, set when embedding search queries and left out for documents. Its tokens bill as input.
