Embeddings & Rerank
Embedding API
Apertis provides the Embedding API for developers to convert text into vectors and find similar text through vector search.
On this page
Usage (Example in Python)
cURL
curl https://api.apertis.ai/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <APERTIS_API_KEY>" \
-d '{
"model": "jina-embeddings-v3",
"input": "The food was delicious and the waiter..."
}'Python
from openai import OpenAI
client = OpenAI(
api_key="<APERTIS_API_KEY>",
base_url="https://api.apertis.ai/v1"
)
response = client.embeddings.create(
model="jina-embeddings-v3",
input="The food was delicious and the waiter..."
)
print(response.data[0].embedding)JavaScript
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: '<APERTIS_API_KEY>',
baseURL: 'https://api.apertis.ai/v1'
});
const response = await client.embeddings.create({
model: 'jina-embeddings-v3',
input: 'The food was delicious and the waiter...'
});
console.log(response.data[0].embedding);Parameters
model: The model to use, currently supportsjina-embeddings-v3,jina-embeddings-v4,jina-embeddings-v5-text-small,jina-embeddings-v5-text-nano,jina-clip-v1,jina-colbert-v2from Jina AI,mistral-embed-2312from Mistral AI andgemini-embedding-2-previewfrom Google. See Models for the current list.input: The text to convertAPERTIS_API_KEY: Your API key