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_KEYParameters
| Field | Type | Required | Description |
|---|---|---|---|
| modelpath | string | Model or engine ID |
Request body
Content-Type:application/json
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | — | |
| input | string | string[] | The text to embed | |
| encoding_format | stringdefault: floatfloatbase64 | — | — |
| dimensions | integer | — | Output vector dimensions |
Responses
200Embedding created
| Field | Type | Required | Description |
|---|---|---|---|
| object | string | — | — |
| data | object[] | — | — |
| object | string | — | — |
| index | integer | — | — |
| embedding | number[] | — | — |
| model | string | — | — |
| usage | object | — | — |
| prompt_tokens | integer | — | — |
| total_tokens | integer | — | — |
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"
}'
