Get API key

Embeddings

View as Markdown

Dense vector representations for retrieval, classification, and clustering.

POST /v1/embeddings turns text into dense vectors: lists of numbers that sit close together when texts mean similar things. Compare them to search, cluster or classify text. The format matches OpenAI's.

curl -s "https://api.privatemind.com/v1/embeddings" \
  -H "Authorization: Bearer $PMIND_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nemotron-3-embed-8b",
    "input": ["the quick brown fox", "jumps over the lazy dog"]
  }' | jq '.data[].embedding | length'
from openai import OpenAI

client = OpenAI(base_url="https://api.privatemind.com/v1", api_key=PMIND_KEY)
resp = client.embeddings.create(
    model="nemotron-3-embed-8b",
    input=["the quick brown fox", "jumps over the lazy dog"],
)
print(len(resp.data[0].embedding))
import OpenAI from 'openai';

const client = new OpenAI({ baseURL: `https://api.privatemind.com/v1`, apiKey: PMIND_KEY });
const resp = await client.embeddings.create({
  model: 'nemotron-3-embed-8b',
  input: ['the quick brown fox', 'jumps over the lazy dog'],
});
console.log(resp.data[0].embedding.length);

Parameters

  • model (required): an embedding model id. Their supported_parameters list in GET /v1/models is empty, so identify them by id or model_type.
  • input (required): a string or an array of strings.
  • encoding_format (default float): float or base64. Base64 is about 4× smaller on the wire, which helps with large batches.
  • dimensions: shorten the vector to N dimensions, if the model supports it, trading some quality for storage.

Response

JSON
{
  "object": "list",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.012, -0.087, ...] },
    { "object": "embedding", "index": 1, "embedding": [0.034, 0.121, ...] }
  ],
  "model": "<embedding-model-id>",
  "usage": { "prompt_tokens": 14, "total_tokens": 14 }
}

completion_tokens is always zero for embeddings. You're billed for input tokens only.

Query and passage prefixes

nemotron-3-embed-8b is trained with a prefix on each side: start search queries with query: and the documents you index with passage: . The API adds no prefix, so put it in the string yourself.

Its vectors have 3840 dimensions and are already L2-normalised (scaled to length 1), so dot product and cosine similarity rank the same.

Batching

Send up to several hundred strings per request. Batching is much faster than one call per string, often 10× or more, because tokenisation and dispatch overhead dominate at small batch sizes.

Warning

Use the same model for ingest and query. Embeddings from different models are not comparable, even when dimension counts match.

Where next

  • Models to identify embedding models in your org's catalog.
  • Rerank to re-order retrieved candidates by relevance before sending them to a model.
  • Rate limits for budget and RPM behaviour on embedding calls.