Skip to main content

client.embeddings.create()

Generate embeddings for one or more input strings.
result = client.embeddings.create(
    model="minnow-em-v1",
    input="query: what is DPDP?",
)

Parameters

model
str
required
Embedding model ID. Example: "minnow-em-v1".
input
str | List[str]
required
A single string or a list of strings to embed.
dimensions
int
Request a specific MRL dimension. Supported values: 896, 512, 256, 128, 64. Defaults to the model’s native dimension (896 for minnow-em-v1).
encoding_format
str
"float" (default) or "base64".
extra
dict
Any additional parameters passed through to the API.

Returns: EmbeddingResponse

FieldTypeDescription
modelstrModel used
dataList[Embedding]One item per input string
usageUsage or NoneToken counts
Each Embedding:
FieldTypeDescription
indexintPosition in the input list
embeddingList[float]The dense embedding vector
objectstrAlways "embedding"

Example — batch with MRL

result = client.embeddings.create(
    model="minnow-em-v1",
    input=[
        "query: insurance claim process",
        "passage: Claims must be filed within 30 days...",
    ],
    dimensions=256,
)

for item in result.data:
    print(f"[{item.index}] dim={len(item.embedding)}")