Skip to content

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.

POST
https://api.dgrid.ai
POST/v1/embeddings
Authorization
Authorization: Bearer <DGRID_API_KEY>
Request
application/json
Response
200 · application/json

Request Body

FieldTypeRequiredDefaultDescription
inputstring or arrayYes-Input text or text array.
modelstringYes-Embedding model ID.
encoding_formatstringNofloatfloat or base64.
dimensionsintegerNo-Output vector dimensions.
userstringNo-End-user identifier.

Response Body

FieldTypeDescription
objectstringAlways list.
dataarrayEmbedding results.
data[].objectstringAlways embedding.
data[].embeddingarrayEmbedding vector.
data[].indexintegerEmbedding index.
modelstringModel used for the request.
usageobjectToken usage summary.

Legacy Engine Embeddings Format

Use the engine-based embeddings request shown in the code example when you need the legacy path format.

POST
https://api.dgrid.ai
POST/v1/engines/{engine}/embeddings
Authorization
Authorization: Bearer <DGRID_API_KEY>
Request
application/json
Response
200 · application/json

Path Parameters

ParameterTypeRequiredDescription
enginestringYesEngine identifier used in the request path, such as string.

Request Body

FieldTypeRequiredDescription
modelstringYesEmbedding model ID used in the JSON body.
inputstringYesInput text to embed.

Response Body

FieldTypeDescription
objectstringAlways list.
dataarrayEmbedding results.
data[].objectstringAlways embedding.
data[].embeddingarrayEmbedding vector.
data[].indexintegerEmbedding index.
modelstringModel used for the request.
usageobjectToken usage summary.