Everstack
API ReferenceGatewayEmbeddings

Embeddings

POST/v1/embeddings
POST/v1/embeddings

Your instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.

Request Body

PropertyTypeRequiredDescription
modelstringNo
inputstringNo
metadataobjectNo
messagesobject[]No

Responses

200 The embeddings

PropertyTypeDescription
resultobject
errorobject

default An unexpected error response.

PropertyTypeDescription
codeinteger
messagestring
detailsobject[]

Request

curl -X POST "http://localhost:8089/openai/v1/embeddings" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"string","input":"string","messages":[{"role":"ROLE_UNSPECIFIED","content":[],"toolCalls":[],"toolCallId":"string","name":"string"}]}'
const response = await fetch("http://localhost:8089/openai/v1/embeddings", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "model": "string",
  "input": "string",
  "messages": [
    {
      "role": "ROLE_UNSPECIFIED",
      "content": [],
      "toolCalls": [],
      "toolCallId": "string",
      "name": "string"
    }
  ]
}),
});
const data = await response.json();
import requests

response = requests.post(
    "http://localhost:8089/openai/v1/embeddings",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
  "model": "string",
  "input": "string",
  "messages": [
    {
      "role": "ROLE_UNSPECIFIED",
      "content": [],
      "toolCalls": [],
      "toolCallId": "string",
      "name": "string"
    }
  ]
},
)
data = response.json()

Response

{
  "result": {
    "object": "string",
    "data": [
      {
        "object": "string",
        "embedding": [],
        "index": 0
      }
    ],
    "model": "string",
    "id": "string",
    "usage": {
      "promptTokens": 0,
      "totalTokens": 0,
      "cost": 0
    }
  },
  "error": {
    "code": 0,
    "message": "string",
    "details": [
      {
        "@type": "string"
      }
    ]
  }
}
{
  "code": 0,
  "message": "string",
  "details": [
    {
      "@type": "string"
    }
  ]
}