Embeddings

Nebula Embedding endpoint takes text in input and returns a vector embedding representation.

Embeddings are generated by calling /v1/model/embed endpoint.

curl --location 'https://api-nebula.symbl.ai/v1/model/embed' \
--header 'ApiKey: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{
    "text": "Dan: Definitely, John. The first feature we'\''re introducing is our new AI-powered recommendation system. The system analyzes user behavior and preferences to suggest the most relevant products."
}'
import requests
import json

NEBULA_API_KEY="YOUR_API_KEY"  # Replace with your API key

url = "https://api-nebula.symbl.ai/v1/model/embed"

payload = json.dumps({
  "text": "Dan: Definitely, John. The first feature we're introducing is our new AI-powered recommendation system. The system analyzes user behavior and preferences to suggest the most relevant products."
})
headers = {
  'ApiKey': NEBULA_API_KEY,
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.json())

Request

Method POST

URL

https://api-nebula.symbl.ai/v1/model/embed

Headers

  • Content-Type: must be set to application/json- Content-Type: application/json
  • ApiKey: must be set to valid API key - ApiKey: <api_key>

Body

{
  "model": "<model name>", // Optional
  "text": "<input text of conversation, document, strings, etc.>"
}
  • model (optional, string): Name of the model. Defaults to nebula-text-embedding-large. If using a custom or fine-tuned model, the respective name of the model should be used.
  • text (string): The text content to generate the embedding. The text can be any string representing document or conversation chunks, keywords, or phrases, depending on the use case.

Response

{
    "model": "<model name>",
    "embedding": [
        <list of floating point numbers reprenting embedding>
    ]
}
  • model (string): The model used to calculate embedding.
  • embedding (embed List[float]): A list of floating point numbers representing the embedding.

Errors

HTTP Error Code is returned in response when the request fails.

Error object:

detail (string): Details about the error.

{
  "detail": "<error message>"
}
Error CodeError Description
400 - Bad RequestThe request body is incorrect.
401 - UnauthorizedInvalid authentication details were provided. Either the API Key is missing or not correct.
429 - Rate limit reachedToo many requests are sent and have exceeded rate limits.
500 - Server errorThe servers had an error while processing the request.
503 - Service UnavailableThe servers are overloaded due to high traffic.