Skip to main content
POST
/
ml
/
v1alpha
/
embedding:embed
cURL
curl --location 'https://api.inworld.ai/ml/v1alpha/embedding:embed' \
--header 'Authorization: Basic <api-key>' \
--header 'Content-Type: application/json' \
--data '{
  "inputs": [
    {
      "text": "Hello Inworld!"
    }
  ],
  "model": {
    "model": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
    "serviceProvider": "SERVICE_PROVIDER_INWORLD"
  }
}'
{
  "embeddings": [
    {
      "values": [
        -0.0034770966,
        0.014472961,
        -0.0031032562,
        0.043792725,
        0.033081055,
        0.003566742,
        -0.048217773,
        0.03970337,
        0.023040771,
        0.006038666
      ]
    }
  ]
}

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