Skip to main content
POST
/
api
/
v1
/
llm
/
embeddings
Typescript (SDK)
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.llm.embeddings.embed({
    embeddingsRequest: {
      input: "The quick brown fox jumps over the lazy dog.",
      model: "meetkai:qwen3-embedding-8b",
    },
  });

  console.log(result);
}

run();
{
  "data": [
    {
      "object": "embedding",
      "embedding": [
        0.0023,
        -0.0091,
        0.0156,
        -0.0042,
        0.0089
      ],
      "index": 0
    }
  ],
  "model": "meetkai:qwen3-embedding-8b",
  "object": "list",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Authorizations

Authorization
string
header
required

Authenticate with your MKA1 API key at the API gateway: Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, also send X-On-Behalf-Of to identify the end user making the request.

Headers

X-On-Behalf-Of
string

Optional external user identifier for multi-user server-side integrations. Use this when acting on behalf of one of your end users.

Body

application/json

Request parameters for creating embeddings. Generates vector representations of the input text(s).

input
required

The input text or array of texts to generate embeddings for. Can be a single string or an array of strings. Note: batch size and input length limits vary by model. See GET /embeddings/models for model-specific limits.

Required string length: 1 - 100000
model
string
required

ID of the model to use for generating embeddings. Use provider:model format. See GET /embeddings/models for available models and their limits.

Minimum string length: 1
dimensions
integer

The number of dimensions the resulting output embeddings should have. Only supported in certain models.

Required range: 1 <= x <= 9007199254740991
encoding_format
enum<string>
default:float

The format to return the embeddings in. Can be either 'float' (array of numbers) or 'base64' (base64-encoded binary).

Available options:
float,
base64
user
string

A unique identifier representing your end-user.

Response

200 - application/json

OK

Response from the embeddings endpoint containing the generated embeddings and usage information.

data
object[]
required

A list of embedding objects. Each object contains the embedding vector as an array of floating point numbers or base64-encoded string representing the semantic meaning of the input text.

model
string
required

The model used for generating the embeddings

object
any
default:list
usage
object

Usage statistics for the embeddings request