Turn text into vectors, and list the embedding models.
| Method | Path | Billed | Does |
|---|---|---|---|
POST | /v1/embeddings | yes | turns text into vectors |
GET | /v1/embeddings/models | free | lists the embedding models on sale |
Both take an API key: Authorization: Bearer $OPENDUNES_API_KEY. The request and answer are the OpenAI library's; the guide is Embeddings.
curl https://opendunes.com/v1/embeddings \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "voyageai/voyage-code-4",
"input": ["Couscous royal, 1 200 DA", "Chorba frik, 450 DA"]
}'The answer's usage.cost is the charge in DA, and it carries X-Generation-Id. A model that is not an embedding model is a 404. The route can answer from the response cache.
curl https://opendunes.com/v1/embeddings/models \
-H "Authorization: Bearer $OPENDUNES_API_KEY"Answers { "data": [ … ] } with the model object.