API documentation

Embeddings

Create vectors for search, RAG, clustering, and ranking.

Embeddings convert text into numeric vectors. Store the vector, source text, metadata, and model id together so you can re-embed cleanly if the model changes.

Single or batch input

bash
curl https://api.aigate.shop/v1/embeddings \  -H "Authorization: Bearer sk-your-api-key" \  -H "Content-Type: application/json" \  -d '{    "model": "qwen/qwen3-embedding-8b",    "input": ["First document", "Second document"],    "encoding_format": "float"  }'

Response

json
{  "object": "list",  "data": [    {      "object": "embedding",      "index": 0,      "embedding": [0.0123, -0.0042, 0.0311]    }  ],  "model": "qwen/qwen3-embedding-8b",  "usage": {    "prompt_tokens": 8,    "total_tokens": 8  }}

Practical notes

  • Split long documents into chunks.
  • Do not mix different embedding models in one vector index unless you know dimensions and distribution match.
  • Re-embed content when you change model or dimensions.
  • Use metadata filters before vector similarity when possible.