AI

Create embeddings

Changed on

Embeds text against the model the resolved site has configured for embeddings, in the OpenAI-compatible request and response shape. The input field accepts either a single string or an array of strings embedded as one batch; the response is always a list with one entry per input, each carrying the index of the input it corresponds to. An absent, null or empty input is refused, as is a blank or whitespace-only string wherever it appears, and every element of an array must be a string — arrays of token ids are not supported. The model field is required and is validated against the site's embeddings configuration, not its chat models; there is no implicit default. Every response reports the serving site in the X-dotCMS-Resolved-Site header.

post/api/inference/v1/embeddings

Request

Query parameters

siteIdstring

Request body

modelstring

Model id, as configured for this site's embeddings

inputJsonNode

Example request

{
  "model": "text-embedding-3-small"
}

Response

The vectors, one per input

objectstring

Object type

modelstring

Model that served the request

Example response

{
  "object": "list",
  "model": "text-embedding-3-small",
  "data": [
    {
      "object": "embedding"
    }
  ]
}

Changes