๐ข Embed
Use the Embed endpoint to obtain a vector representation of a string (see embeddings).
Available at https://api.lighton.ai/muse/v1/embed
.
๐ธ๏ธ Pricing
You will be billed for the total number of tokens sent in your request.
Exampleโ
- cURL
- Python
- JavaScript
curl -X 'POST' \
'https://api.lighton.ai/muse/v1/embed' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-API-KEY: YOUR_API_KEY' \
-H 'X-Model: orion-fr' \
-d '{"text": "Il รฉtait une fois en Laponie"}'
from lightonmuse import Embed
embedder = Embed("orion-fr")
outputs, cost, request_id = embedder("Il รฉtait une fois en Laponie")
let { response, error } = client.query(ApiModel.OrionFr, Endpoint.Embed, {
text: 'Il รฉtait une fois en Laponie',
});
Response (JSON)
{
"request_id": "a0b4f1e0-e1a7-48b9-8204-6567efe3957d",
"outputs": [
[
{
"execution_metadata": {
"cost": {
"tokens_used": 8,
"tokens_input": 8,
"tokens_generated": 0,
"cost_type": "orion-fr@default",
"batch_size": 1
},
"finish_reason": "length"
},
"text": "Il รฉtait une fois en Laponie",
"embedding": [
-0.28515625, -0.67724609375, -0.0014142990112304688,
//...
1.488525390625, 0.08782958984375
]
}
]
],
"costs": {
"orion-fr@default": {
"total_tokens_used": 8,
"total_tokens_input": 8,
"total_tokens_generated": 0,
"batch_size": 1
}
}
}
Parametersโ
text
string/array[string] โ ๏ธ requiredThe input(s) that will be represented.
Response (outputs
)โ
An array of outputs shaped like your batch.
execution_metadata
ExecutionMetadataAn Execution metadata structure.
text
stringThe text that was represented, from the provided
text
parameter.embedding
array[float]Vector representation of the provided text. The size of the representation depends on the model used, see models for details.