Embeddings API

Turn text into vector embeddings for search and retrieval with the Pendra API. OpenAI-compatible.

POST /api/v1/embeddings
New to embeddings? Start with the Embeddings guide. This page is the field-by-field reference.
Body application/json
model string Required
Embedding model ID. List the options at /models?type=embedding.
input string | string[] Required
A single string, or an array of strings to embed in one request.
encoding_format string default: float
float returns vectors as JSON arrays; base64 packs them into a smaller string for big batches.
dimensions integer
Shorten each vector to this many numbers, on models that support it, such as embeddinggemma:300m.
input_type string default: document
document for text you store, query for a search against it, or none to embed the text exactly as sent. See Queries and documents.
user string
Accepted for OpenAI compatibility and ignored.

Response

data has one embedding per input, in the order you sent them, with its index.

Good to know

  • For large jobs, send a few hundred strings per request rather than one huge one.
  • Vector length depends on the model. See the model catalogue.