Embeddings
Embeddings are numerical vectors that represent text’s meaning, enabling machines to compare and analyze language. They power tasks like search, classification, and recommendations by capturing semantic relationships in a compact form.
To get a full list of embedding models visit cortecs.ai and filter by the Embedding tag.
from openai import OpenAI
client = OpenAI(
base_url="https://api.cortecs.ai/v1/embeddings",
api_key="<API_KEY>",
)
response = client.embeddings.create(
input="Your text string goes here",
model="<MODEL_NAME>"
)
print(response.data[0].embedding)import OpenAI from "openai";
const openai = new OpenAI({
baseURL: 'https://api.cortecs.ai/v1/embeddings',
apiKey: '<API_KEY>'
});
const embedding = await openai.embeddings.create({
model: "<MODEL_NAME>",
input: "Your text string goes here"
});
console.log(embedding);curl https://api.cortecs.ai/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"input": "Your text string goes here",
"model": "<MODEL_NAME>"
}'Last updated