Get startedAPI referenceGoing to productionExplore models

API reference

Embeddings

Convert text into vectors for semantic search, clustering, recommendations, and retrieval. The selected model must advertise the embeddings capability.

POST/v1/embeddings

Request parameters

modelstring · required

Public model ID from /v1/models.

inputstring | array · required

A string or an array of strings. An empty array or a null item returns 400.

dimensionsinteger · optional

Output vector length, for models that support shortened embeddings. When omitted, the model’s default size is used.

encoding_formatstring · optional

Not forwarded. Vectors are always returned as float arrays.

Embedding request
{
  "model": "pico-embedding-1",
  "input": ["First document", "Second document"],
  "dimensions": 256
}
Copied