Saltar al contenido principal
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
  }
}

Autorizaciones

Authorization
string
header
requerido

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

Parámetros de ruta

engine
string
requerido

Engine identifier used in the request path.

Cuerpo

application/json
model
string
requerido

Embedding model ID used in the JSON body.

input
string
requerido

Input text to embed.

Respuesta

Embedding results.

object
string

Always list.

data
object[]

Embedding results.

model
string

Model used for the request.

usage
object