Create Embeddings
Authorizations
Enter your MeshAPI key (rsk_...) — sent as Authorization: Bearer <key>.
Body
Request body for POST /v1/embeddings.
Mirrors the OpenAI embeddings API. The input field accepts
four shapes:
- string — a single text to embed
- list[string] — a batch of texts
- list[int] — a single pre-tokenised input (token IDs)
- list[list[int]] — a batch of pre-tokenised inputs
Text(s) to embed. Accepts a string, list of strings, list of token IDs, list of token ID lists, or a list of MultimodalEmbeddingInput objects (for BytePlus multimodal embedding models).
Model ID to use for embedding, e.g. perplexity/pplx-embed-v1-4b.
"perplexity/pplx-embed-v1-4b"
Number of dimensions for the output embedding vector (model-dependent).
x >= 1Format of the returned embedding. Defaults to float.
float, base64 Intended use of the embedding, e.g. query or document. Some models use this to apply asymmetric embedding.
Provider routing preferences. Pass a provider slug string (e.g. 'perplexity') or a ProviderPreferences object to control fallback and ordering behaviour.
End-user identifier for abuse monitoring.
256Inference prompt for BytePlus multimodal embeddings. A default is generated from the input modality if not set.
Sparse vector switch for BytePlus text embeddings. Pass {"type": "enabled"} to return both dense and sparse vectors, or {"type": "disabled"} for dense only.
Response
Embedding response