Skip to content
StatusGet API key

Embeddings

POST /v1/embeddings returns one vector per input text. The embedding model is baai/bge-m3 (alias bge-m3): multilingual, up to 8,192 input tokens per text, 1,024-dimension vectors. Its price is on the model page.

Terminal window
curl https://api.thetoken.dev/v1/embeddings \
-H "Authorization: Bearer $TOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "baai/bge-m3",
"input": ["Where is my order?", "أين طلبي؟"]
}'

The response (vectors shortened):

{
"object": "list",
"model": "baai/bge-m3",
"data": [
{ "object": "embedding", "index": 0, "embedding": [-0.0312, 0.0187, 0.0054] },
{ "object": "embedding", "index": 1, "embedding": [-0.0298, 0.0201, 0.0049] }
],
"usage": { "prompt_tokens": 12, "total_tokens": 12 }
}
  • input is a string or a list of strings; results come back in the same order (index).
  • Compare vectors with cosine similarity. Texts in different languages with the same meaning land close together, as in the example.
  • Only input tokens are billed; embeddings have no output price.
  • Some clients send token numbers instead of text (LangChain’s Python OpenAIEmbeddings by default); send text. See the LangChain guide.