Perform text embedding inference on the service Generally available; Added in 8.11.0
Query parameters
-
Specifies the amount of time to wait for the inference request to complete.
Values are
-1
or0
.
POST /_inference/text_embedding/{inference_id}
curl \ --request POST 'http://api.example.com/_inference/text_embedding/{inference_id}' \ --header "Authorization: $API_KEY" \ --header "Content-Type: application/json" \ --data '"{\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n}"'
Request example
Run `POST _inference/text_embedding/my-cohere-endpoint` to perform text embedding on the example sentence using the Cohere integration,
{ "input": "The sky above the port was the color of television tuned to a dead channel.", "task_settings": { "input_type": "ingest" } }
Response examples (200)
An abbreviated response from `POST _inference/text_embedding/my-cohere-endpoint`.
{ "text_embedding": [ { "embedding": [ { 0.018569946, -0.036895752, 0.01486969, -0.0045204163, -0.04385376, 0.0075950623, 0.04260254, -0.004005432, 0.007865906, 0.030792236, -0.050476074, 0.011795044, -0.011642456, -0.010070801 } ] } ] }