Embedding
curl https://dekallm.cloudeka.ai/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"input": "Your text string goes here",
"model": "baai/bge-multilingual-gemma2"
}'import requests
# URL endpoint
url = "https://dekallm.cloudeka.ai/v1/embeddings"
# Header with type conten and authorization
headers = {
"Content-Type": "application/json",
"Authorization": "API_KEY" # replace API_KEY with your API key
}
# JSON data to be sent
data = {
"input": "Your text string goes here",
"model": "baai/bge-multilingual-gemma2"
}
# Request POST
response = requests.post(url, headers=headers, json=data)
# Checks whether the request was successful
if response.status_code == 200:
print("Response:", response.json())
else:
print("Failed to get embeddings. Status code:", response.status_code)
print("Response:", response.text){
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [
0.0023064255,
-0.009327292,
.... (1536 floats total for ada-002)
-0.0028842222,
],
"index": 0
}
],
"model": "text-embedding-ada-002",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}Last updated
