Embedding Generation
Embedding models are machine learning models that convert data (such as text, images, or code) into dense numerical vectors in a continuous space. These vectors, called embeddings, capture the semantic relationships between different pieces of data, enabling efficient comparison and retrieval.
Models available
🚀 Free Models
Qwen3-Embedding-8B (
Qwen/Qwen3-Embedding-8B): 8B parameter embedding model for text similarity and retrieval - Free
Reranking Models
BGE-Reranker-V2-M3 (
BAAI/bge-reranker-v2-m3): 0.6B parameter reranking model for search optimization - Free
Using the Models
Through API Endpoint
This option is to use our API endpoint directly in your projects. Below are some code snippets to get you started!
NOTE: Don't forget to use your API key. See Authentication for details on authentication and Create API Key for managing keys.
Using cURL
curl -X POST "https://api.meganova.ai/v1/embeddings" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MegaNova_API_KEY" \
--data-raw '{
"model":"Qwen/Qwen3-Embedding-8B",
"input":[
"Bananas are berries, but strawberries are not, according to botanical classifications.",
"The Eiffel Tower in Paris was originally intended to be a temporary structure."
]
}'Using Python
Using JavaScript
Selecting a Model
To specify the desired model, use this mapping for the model:
Embedding Models
Qwen3-Embedding-8B:
Qwen/Qwen3-Embedding-8B
Reranking Models
BGE-Reranker-V2-M3:
BAAI/bge-reranker-v2-m3
Response Example
A successful response body will return the embeddings in this format:
NOTE: Notice that there are 2 embeddings, each with its own index number. These embeddings correspond to the given input sentences, of which there are 2. You can choose how many sentences to create embeddings for, this is just an example.
Feel free to explore refer to the API Reference for more details.
Last updated