Skip to main content
Base URL: https://api.freemodel.app/v1
Create numerical vector representations for text.

Create embeddings

POST /embeddings Choose an embedding-capable model from GET /v1/models. The example uses <embedding-model-id> to avoid assuming model availability for every account.
curl https://api.freemodel.app/v1/embeddings \
  -H "Authorization: Bearer sk-xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<embedding-model-id>",
    "input": "FreeModel provides a unified AI API."
  }'
Response
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [0.0123, -0.0456, 0.0789]
    }
  ],
  "model": "<embedding-model-id>",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Request body

FieldTypeRequiredDescription
modelstringYesAn embedding model ID returned for your API key.
inputstring or arrayYesOne text input or an array of text inputs.
encoding_formatstringNoOutput encoding when supported by the selected model.
Do not mix vectors from different embedding models in the same similarity index.