Skip to main content

πŸ”’ Embed

Status: Alpha

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 -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"}'
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] ⚠️ required

    The input(s) that will be represented.

Response (outputs)​

An array of outputs shaped like your batch.

  • execution_metadata ExecutionMetadata

    An Execution metadata structure.

  • text string

    The 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.