Embeddings
POST /v1/embeddings — create vector embeddings through the assigned route.
Request
curl https://ai.latentkit.com/v1/embeddings \
-H "Authorization: Bearer $LATENTKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": ["hello world", "LatentKit routes by API key"],
"dimensions": 256
}'Fields
| Field | Description |
|---|---|
input | String or array of strings to embed (required) |
dimensions | Optional output dimensionality when the route model supports it |
encoding_format | Optional encoding format when supported (e.g. float, base64) |
The route must include a model with the embeddings capability. POST /v1/embed is an alias of /v1/embeddings — both accept the same body.
Embed all vectors you compare with each other using the same pinned model. If the route can fail over between embedding models, vectors from different models are not comparable. Pin one embedding model in the routing policy for vector-store workloads.
SDK
const vectors = await client.embeddings.create({
input: ['hello world'],
dimensions: 256,
});vectors = client.embeddings.create(
input=["hello world"],
dimensions=256,
)Free plan note
Plain embeddings requests may count toward a workspace managed onboarding allowance on Free plans. After limits or without credits, add credits or use BYOK routes.