Skip to main content
POST
/
ml
/
v1alpha
/
embedding:embed
curl --request POST \
--header 'Authorization: Basic API_KEY' \
--header 'Content-Type: application/json' \
--url 'https://api.inworld.ai/ml/v1alpha/embedding:embed' \
--data '{
"inputs": [{"text": "Hello Inworld!"}],
"model": {
"model": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
"serviceProvider": "SERVICE_PROVIDER_INWORLD"
}
}'
{
"embeddings": [
{
"values": [
0.009628296,
-0.03213501,
-0.0030879974,
0.008979797,
0.0146102905,
0.043426514,
-0.13269043,
0.02420044,
-0.013900757,
0.029541016
]
}
]
}

Authorizations

Authorization
string
header
required

Should follow the format Basic {credentials}. The {credentials} consists of the Base64-encoded string of the API key and the secret in the format key:secret

Body

application/json

Request message for Embed method. Contains the input texts and model configuration for the embeddings request

inputs
object[]
required

Input to embed.

model
object
required

The ID of the model to be used to generate embeddings. If no model_id is specified, the default model will be used. See Models for available models.

Response

A successful response message for Embed method

embeddings
object[]

List of embeddings generated from the input messages