NeuraLex API Reference

Integrate NeuraLex's hybrid embedding technology natively into your applications.


Authentication

All API requests require an API Key to be valid. You can obtain an API Key from your dashboard after signing up.

Pass the API Key in the X-Api-Key HTTP header.

HTTP Header
X-Api-Key: nlx_12345xxxxxxxxxxxxxxxxxxx

Embeddings

The core resource of NeuraLex. Generate high-dimensional hybrid vectors representing both the semantic meaning and exact symbolic content of your text.

POST https://api.neuralex.ca/api/v1/embed

Generates an embedding vector for the provided text input.

Request Parameters

Parameter Type Required Default Description
inputs List<string> Yes - Array of strings to generate embeddings for. Can be a single sentence or multiple paragraphs.
model string No "public" The model identifier to use. Custom models for enterprise clients can be specified here.
language string No "english" Language of the input text. Currently supports 'english'.
semanticWeight float No 0.5 Controls the balance between symbolic (keyword) and semantic (concept) representations.
  • 0.0: Pure Symbolic (Bag-of-words / Keyword matching)
  • 0.5: Hybrid (Recommended)
  • 1.0: Pure Semantic (Dense Vector / Transformer)

Example Request

curl -X POST https://api.neuralex.ca/api/v1/embed \
  -H "X-Api-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": ["The quick brown fox jumps over the lazy dog"],
    "model": "public",
    "semanticWeight": 0.5
  }'

Response Body

Field Type Description
payload List With Object Configuration containing the embedding results.
payload[].text string The original input text for this item.
payload[].embedding List<float> The generated high-dimensional vector.
payload[].usage Object Token usage statistics for this specific input.
totalUsage Object Aggregate token usage for the entire request.

Example Response

{
  "payload": [
    {
      "text": "The quick brown fox jumps over the lazy dog",
      "embedding": [
        0.0123, -0.0456, 0.789, ... 
        // 1024 dimensions
      ],
      "usage": {
        "totalTokens": 9
      }
    }
  ],
  "model": "public",
  "totalUsage": {
    "totalTokens": 9
  }
}

Error Codes

Status Error Description
400 Bad Request Invalid input format or unknown model.
401 Unauthorized Missing or invalid API Key.
402 Payment Required Usage limit exceeded or account suspended.
503 Service Unavailable Embedding service is temporarily overloaded or down.