Embeddings

Create vector embeddings through the same project-scoped API and provider routing as your prompts — for semantic search, RAG, and clustering.

Endpoint

POST /v1/:projectId/embeddings

Authenticate with x-api-key — see Authentication. (A bare POST /v1/embeddings is also accepted if you pass the project id in an x-project-id header.)

Request

curl -X POST \
  https://router.promptlab.vernalabs.net/v1/YOUR_PROJECT_ID/embeddings \
  -H "x-api-key: plp_xxx_xxx" \
  -H "Content-Type: application/json" \
  -d '{
        "input": ["how do I reset my password?", "billing FAQ"],
        "model": "text-embedding-3-small"
      }'
FieldTypeNotes
inputstring | string[]One or more texts to embed
modelstringOptional. Defaults to text-embedding-3-small (1536 dims)
dimensionsnumberOptional. Reduce the output dimensionality if the model supports it

Response

{
  "model": "text-embedding-3-small",
  "provider": "openai",
  "dimension": 1536,
  "embeddings": [[0.0123, -0.0456, "…"], [0.0789, -0.0011, "…"]],
  "usage": { "promptTokens": 12, "totalTokens": 12 }
}

embeddings is an array of vectors, aligned to the order of input.

The default embedding model is configurable per deployment. If you rely on a specific model or dimensionality, pass model (and dimensions) explicitly.