Skip to main content
POST
Creates numerical vector representations of text. Vectors from the same model can be compared for semantic similarity and used in retrieval pipelines.

Endpoint

Headers

Authorization
string
required
API key using the format Bearer $YELU_API_KEY.
Content-Type
string
required
Must be application/json.

Request body

model
string
required
An embedding-capable model ID available to your account.
input
string | string[]
required
Text or batch of texts to embed. Empty input and inputs beyond the model’s context limit are rejected.
encoding_format
string
default:"float"
float for a JSON number array or base64 for encoded vector bytes when supported.
dimensions
integer
Requested output dimensions on models that support shortening embeddings.
user
string
Stable, non-sensitive end-user identifier when accepted by the selected provider.

Response

object
string
required
Always list.
data
array
required
One embedding per input, in input order. Each item contains object, index, and embedding.
model
string
required
Model used to create the vectors.
usage
object
Token accounting with prompt_tokens and total_tokens when supplied.

Error codes

Do not compare vectors produced by different models or dimension settings. Re-embed the entire corpus when you change either one, and version the index metadata alongside the vectors.
Last modified on July 13, 2026