Call the iDreame Embeddings API
Goal
Query available models and complete one embeddings request.
Prerequisites
Create an iDreame API token and install curl.
Steps
- Run
export IDREAME_API_KEY="replace-with-your-token"; never store the token in the repository. - request
GET https://api.idreame.ai/v1/modelsand choose a real model ID suitable for the task. - Run
export IDREAME_MODEL_ID="replace-with-model-id". - Send
{"model":"$IDREAME_MODEL_ID","input":"short test text"}toPOST https://api.idreame.ai/v1/embeddingswith the Bearer header. - Inspect the vector data and model fields before choosing a storage format.
Expected result
The API returns JSON containing a vector suitable for later similarity calculations.
Troubleshooting
- 401: check the token and Bearer format.
- model_not_found: query the model list again.
- Input is too long: split the text and preserve chunk order.