Skip to content

Call the iDreame Embeddings API

Goal

Query available models and complete one embeddings request.

Prerequisites

Create an iDreame API token and install curl.

Steps

  1. Run export IDREAME_API_KEY="replace-with-your-token"; never store the token in the repository.
  2. request GET https://api.idreame.ai/v1/models and choose a real model ID suitable for the task.
  3. Run export IDREAME_MODEL_ID="replace-with-model-id".
  4. Send {"model":"$IDREAME_MODEL_ID","input":"short test text"} to POST https://api.idreame.ai/v1/embeddings with the Bearer header.
  5. 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.

OpenAI-compatible · Multimodal AI gateway