Skip to main content
POST
/
v1
/
engines
/
{engine}
/
embeddings
Create embeddings (legacy engines)
curl --request POST \
  --url https://api.dgrid.ai/v1/engines/{engine}/embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "text-embedding-ada-002",
  "input": "The quick brown fox"
}
'
{
  "object": "<string>",
  "data": [
    {
      "object": "<string>",
      "embedding": [
        123
      ],
      "index": 123
    }
  ],
  "model": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Your DGrid API key. All endpoints use Authorization: Bearer <DGRID_API_KEY>.

Path Parameters

engine
string
required

Engine identifier used in the request path.

Body

application/json
model
string
required

Embedding model ID used in the JSON body.

input
string
required

Input text to embed.

Response

Embedding results.

object
string

Always list.

data
object[]

Embedding results.

model
string

Model used for the request.

usage
object