Embeddings
The Embeddings API supports both OpenAI-compatible and Gemini-native vector generation for retrieval, clustering, and semantic similarity workloads.
Native OpenAI Format
Use the OpenAI-compatible embeddings endpoint when you want simple SDK-based integration and broad ecosystem support.
https://api.dgrid.ai
POST
/v1/embeddingsRequest Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
input | string or array | Yes | - | Input text or text array. |
model | string | Yes | - | Embedding model ID. |
encoding_format | string | No | float | float or base64. |
dimensions | integer | No | - | Output vector dimensions. |
user | string | No | - | End-user identifier. |
Response Body
| Field | Type | Description |
|---|---|---|
object | string | Always list. |
data | array | Embedding results. |
data[].object | string | Always embedding. |
data[].embedding | array | Embedding vector. |
data[].index | integer | Embedding index. |
model | string | Model used for the request. |
usage | object | Token usage summary. |
Legacy Engine Embeddings Format
Use the engine-based embeddings request shown in the code example when you need the legacy path format.
https://api.dgrid.ai
POST
/v1/engines/{engine}/embeddingsPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
engine | string | Yes | Engine identifier used in the request path, such as string. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Embedding model ID used in the JSON body. |
input | string | Yes | Input text to embed. |
Response Body
| Field | Type | Description |
|---|---|---|
object | string | Always list. |
data | array | Embedding results. |
data[].object | string | Always embedding. |
data[].embedding | array | Embedding vector. |
data[].index | integer | Embedding index. |
model | string | Model used for the request. |
usage | object | Token usage summary. |
