Create embeddings

post/v1/embeddings

Convert text into vector embeddings.

Authentication

Send your OLETOKEN API key as a Bearer token. Keys are created on the API Keys page of the console.

Authorization: Bearer $OLETOKEN_API_KEY

Request body

Content-Type:application/json

FieldTypeRequiredDescription
modelstring—
inputstring | string[]The text to embed
encoding_formatstringdefault: floatfloatbase64——
dimensionsinteger—Output vector dimensions

Responses

200Embedding created

FieldTypeRequiredDescription
objectstring——
dataobject[]——
objectstring——
indexinteger——
embeddingnumber[]——
modelstring——
usageobject——
prompt_tokensinteger——
total_tokensinteger——

Example request

curl -X POST 'https://api.oletoken.ai/v1/embeddings' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "text-embedding-ada-002",
    "input": "string"
  }'