Embeddings

POST /v1/embeddings turns text into vectors you can index, compare, and search over. This page covers the request shape, batching multiple inputs, choosing a vector size, and using embeddings for retrieval.

Generating embeddings

Send one string or an array of strings as input, with model set to embed-text-v2:

curl https://setcloud.com/v1/embeddings \
  -H "Authorization: Bearer $SETCLOUD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "embed-text-v2",
    "input": ["How do CNAME records work?", "DNS propagation explained"]
  }'

The response’s data array holds one embedding per input, in the same order you sent them.

Batching

Send an array instead of a single string to embed many inputs in one request — up to 96 strings, each up to 50,000 characters. Batching reduces round trips, but it does not reduce the per-input request-rate weight: a batch of 20 strings uses 20 request units.

Dimensionality

By default a vector comes back at its full 1024 dimensions. Pass "dimensions": 256 or "dimensions": 512 to get a shorter vector instead — useful when a vector database or index caps dimension count, or when you want a smaller index at a small cost in retrieval precision.

Retrieval usage

A typical pipeline embeds your documents once at ingest time, stores the vectors, then embeds each incoming query the same way and compares it against the stored set to find the closest matches. Keep the model and dimensions you index with consistent between ingest and query — vectors produced with different settings aren’t comparable.

Next

  • Embeddings reference — request/response shape, encoding formats, and rate-limit weighting.
  • Models — where embed-text-v2 sits in the catalog.