POST
/
v1
/
embeddings
import { AtomaSDK } from "atoma-sdk";

const atomaSDK = new AtomaSDK({
  bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await atomaSDK.embeddings.create({
    model: "intfloat/multilingual-e5-large-instruct",
    input: "The quick brown fox jumped over the lazy dog",
    encoding_format: "float",
  });

  // Handle the result
  console.log(result);
}

run();
{
  "data": [
    {
      "embedding": "[0.0023064255, -0.009327292]",
      "index": 0,
      "object": "embedding"
    }
  ],
  "model": "intfloat/multilingual-e5-large-instruct",
  "object": "list",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request object for creating embeddings

input
required

Input text to get embeddings for. Can be a string or array of strings. Each input must not exceed the max input tokens for the model

Example:

"The quick brown fox jumped over the lazy dog"

model
string
required

ID of the model to use.

Example:

"intfloat/multilingual-e5-large-instruct"

dimensions
integer | null

The number of dimensions the resulting output embeddings should have.

Required range: x >= 0
encoding_format
string | null

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

Example:

"float"

user
string | null

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

Example:

"user-1234"

Response

200
application/json
Embeddings generated successfully

Response object from creating embeddings

data
object[]
required

List of embedding objects

Individual embedding object in the response

model
string
required

The model used for generating embeddings

Example:

"intfloat/multilingual-e5-large-instruct"

object
string
required

The object type, which is always "list"

Example:

"list"

usage
object
required

Usage statistics for the request