BETA

alEmbedding

Turn text into vectors for search and retrieval, through the OpenAI-compatible embeddings endpoint. Needs a key with the alembedding scope.

POSTEmbeddings

Path
/v1/embeddings
Key scope
alembedding

Create Embeddings

Creates an embedding vector representing the input text

POST

Endpoint:

endpoint
https://alapi.deep.sa/v1/embeddings

Request Body:

request.json
{
  "model": "deep-sa/alEmbedding",
  "input": "The quick brown fox jumps over the lazy dog"
}

Parameters:

Name Type Required Description
model string Yes ID of the embedding model to use
input string | array Yes Text to embed: a non-empty string, or an array of non-empty strings (an empty one fails the whole request)
encoding_format string No Format for the embeddings: 'float' or 'base64'. Default: float
dimensions integer No Number of dimensions for the output embeddings (model-dependent)
input_type string No deep-sa/alEmbedding-2.0 only: "query" (default) for search text, "passage" for text you store. Exactly one of the two; the response echoes it

Response (200 OK):

response.json
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [0.0023064255, -0.009327292, ...]
    }
  ],
  "model": "deep-sa/alEmbedding",
  "usage": {
    "prompt_tokens": 9,
    "total_tokens": 9
  }
}

Code Examples:

main.py
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://alapi.deep.sa/v1"
)

response = client.embeddings.create(
    model="deep-sa/alEmbedding",
    input="The quick brown fox jumps over the lazy dog"
)

embedding = response.data[0].embedding
print(f"Embedding dimension: {len(embedding)}")

Ready to Get Started?

Generate an API key from your dashboard and start building

Activate account?

Activate this account?