Light Logo
Openai

Create an embedding

OpenAI compatible embeddings endpoint. If the model does not respond in time, the request will be timed out and the prediction will be cancelled.

POST
/embeddings
AuthorizationBearer <token>

In: header

modelModel

The model to use for this OpenAI compatible endpoint. Models must be in the following format: model_owner/model_name or model_owner/model_name:version_number.

inputInput

Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays.

dimensions?Dimensions

The number of dimensions the resulting output embeddings should have.

encoding_format?Encoding Format

The format to return the embeddings in.

Response Body

curl -X POST "https://api.wrift.ai/v1/embeddings" \  -H "Content-Type: application/json" \  -d '{    "model": "string",    "input": "string"  }'
{
  "data": [
    {
      "embedding": [
        0
      ],
      "index": 0,
      "object": "embedding"
    }
  ],
  "model": "string",
  "object": "list",
  "usage": {
    "prompt_tokens": 0,
    "total_tokens": 0
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}