Skip to main content

Batched Semantic Embeddings

POST 

https://api.aleph-alpha.com/batch_semantic_embed

Embeds multiple prompts using a specific model and semantic embedding method. Resulting vectors that can be used for downstream tasks (e.g. semantic similarity) and models (e.g. classifiers). To obtain a valid model, use GET /models_available.

Request

Responses

OK

Authorization: http

name: tokentype: httpscheme: bearerdescription: Can be generated in your [Aleph Alpha profile](https://app.aleph-alpha.com/profile)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.aleph-alpha.com/batch_semantic_embed");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <TOKEN>");
var content = new StringContent("{\n \"model\": \"luminous-base\",\n \"prompt\": \"An apple a day keeps the doctor away.\",\n \"representation\": \"symmetric\",\n \"compress_to_size\": 128\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://api.aleph-alpha.com
Auth
Parameters
— query
Body required
{
  "model": "luminous-base",
  "prompt": "An apple a day keeps the doctor away.",
  "representation": "symmetric",
  "compress_to_size": 128
}
ResponseClear

Click the Send API Request button above and see the response here!