Guides
Cortiqa embeddings convert natural language text into dense, high-dimensional floating-point vectors that capture semantic relationships, concepts, and intent.
Embeddings enable computers to understand semantic similarity. Texts with similar meanings (such as “How do I reset my password?” and “Forgot credentials recovery”) map close together in vector space.
You can generate embeddings via direct REST HTTP or using any OpenAI-compatible client library:
curl https://api.cortiqa.co/api/v1/embeddings \
-H "Authorization: Bearer sk-cortiqa-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-small",
"input": "Cortiqa is an ultra-fast AI inference platform."
}'Example response containing the 1536-dimensional float vector:
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [-0.0069, -0.0053, 0.0125, -0.0241, 0.0089, ...]
}
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 10,
"total_tokens": 10
}
}Use standard cosine similarity or inner product (dot product on normalized vectors) to compare two vectors:
import numpy as np
def cosine_similarity(v1, v2):
return np.dot(v1, v2) / (np.linalg.norm(v1) * np.linalg.norm(v2))
# Scores range from -1.0 (opposite) to 1.0 (identical meaning)input: ["text 1", "text 2"] to maximize throughput.