curl --request POST \
--url 'https://api.elkapi.com/v1/embeddings' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "text-embedding-3-large",
"input": "The weather is great today, perfect for a walk."
}'
import requests
url = "https://api.elkapi.com/v1/embeddings"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "text-embedding-3-large",
"input": "The weather is great today, perfect for a walk."
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/embeddings";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "text-embedding-3-large",
"input": "The weather is great today, perfect for a walk."
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 1,
"embedding": [
1
]
}
],
"model": "text-embedding-3-large",
"usage": {
"prompt_tokens": 1,
"total_tokens": 1
}
}
Native OpenAI Format
Create Embedding
- Convert text into vector embeddings
POST
/
v1
/
embeddings
curl --request POST \
--url 'https://api.elkapi.com/v1/embeddings' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "text-embedding-3-large",
"input": "The weather is great today, perfect for a walk."
}'
import requests
url = "https://api.elkapi.com/v1/embeddings"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "text-embedding-3-large",
"input": "The weather is great today, perfect for a walk."
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/embeddings";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "text-embedding-3-large",
"input": "The weather is great today, perfect for a walk."
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 1,
"embedding": [
1
]
}
],
"model": "text-embedding-3-large",
"usage": {
"prompt_tokens": 1,
"total_tokens": 1
}
}
curl --request POST \
--url 'https://api.elkapi.com/v1/embeddings' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "text-embedding-3-large",
"input": "The weather is great today, perfect for a walk."
}'
import requests
url = "https://api.elkapi.com/v1/embeddings"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "text-embedding-3-large",
"input": "The weather is great today, perfect for a walk."
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/embeddings";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "text-embedding-3-large",
"input": "The weather is great today, perfect for a walk."
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 1,
"embedding": [
1
]
}
],
"model": "text-embedding-3-large",
"usage": {
"prompt_tokens": 1,
"total_tokens": 1
}
}
Authorizations
string
required
All endpoints require Bearer Token authentication.Add it to the request headers:
Authorization: Bearer YOUR_API_KEY
Body
string
default:"text-embedding-3-large"
required
Example:
text-embedding-3-largestring or array<string>
required
Text to embed
string
default:"float"
Allowed values:
float, base64integer
Output vector dimensions
Response
string
Example:
liststring
default:"text-embedding-3-large"
Example:
text-embedding-3-large⌘I