API reference · Embeddings
Embeddings.
Vectors for retrieval and agent memory, next to your chat calls — same key, same origin. One embedding model: lx1-embed, 768 dimensions, OpenAI-compatible.
Endpoint
POST
/v1/embeddingsAuthenticate with Authorization: Bearer lx1_.... The embedding model is lx1-embed and produces 768-dimensional vectors.
Request parameters
| Parameter | Type | Notes |
|---|---|---|
model | string | lx1-embed. |
input | string | string[] · required | One text or a batch — up to 2,048 items per request. Token arrays are not supported. |
encoding_format | string | float (default) or base64. |
dimensions | integer | Optional; must be 768 if set — the model has one output size. |
Example
curl https://api.layerx1.in/v1/embeddings \
-H "authorization: Bearer $LAYERX1_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "lx1-embed",
"input": ["agent memory entry one", "agent memory entry two"]
}'{
"object": "list",
"data": [
{ "object": "embedding", "index": 0, "embedding": [0.013, -0.021, ...] },
{ "object": "embedding", "index": 1, "embedding": [0.007, 0.049, ...] }
],
"model": "lx1-embed",
"usage": { "prompt_tokens": 12, "total_tokens": 12 }
}Note
Vectors come back in input order — index matches the position of each text in input. Cosine similarity is the intended distance measure.
Errors
Empty input, more than 2,048 items, or a dimensions value other than 768 return 400 with an OpenAI-shaped body. Full reference: Errors.