For the complete documentation index, see llms.txt. This page is also available as Markdown.

Embeddings

Create vector embeddings for input text.

Create embeddings

post

Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
modelstringRequiredExample: Text Embedding 3 Large
inputone ofOptional

Input text to get embeddings for.

stringOptionalExample: The food was delicious and the waiter...
or
string[]OptionalExample: ["The food was delicious","The waiter was friendly"]
or
integer[]OptionalExample: [1,2,3,4,5]
or
encoding_formatstring · enumOptional

The format to return the embeddings in. Can be either float or base64.

Default: floatPossible values:
dimensionsinteger · min: 1Optional

The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.

Example: 1536
Responses
200

Represents an embedding response returned by model, based on the provided input.

application/json
objectstringOptional

The object type, which is always "list"

Example: list
modelstringOptional

The model used for generating embeddings

post/v1/embeddings
POST /v1/embeddings HTTP/1.1
Host: api.nexos.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 98

{
  "model": "Text Embedding 3 Large",
  "input": "There are three letters 'r' in the word 'strawberry'."
}
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        0.0023064255,
        -0.009327292
      ],
      "index": 0
    }
  ],
  "model": "text",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8,
    "nexos_credits_cost": 0.000016
  }
}

Last updated