Gemini embeddings

post/v1/engines/{model}/embeddings

Create embeddings with the specified engine or model.

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

Parameters

FieldTypeRequiredDescription
modelpathstringModel or engine ID

Request body

Content-Type:application/json

FieldTypeRequiredDescription
modelstring
inputstring | string[]The text to embed
encoding_formatstringdefault: floatfloatbase64
dimensionsintegerOutput 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/engines/{model}/embeddings' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "text-embedding-ada-002",
    "input": "string"
  }'