Skip to content

Authentication

API keys, JWT tokens, and authentication methods

Authentication

Every request to the Engram API requires authentication. Engram uses API keys for server-to-server communication and JWT tokens for dashboard access.

Base URL

https://api.engrammemory.ai/v1

API Key Format

Engram issues two types of API keys:

PrefixEnvironmentPurpose
pr_live_*ProductionLive traffic, usage counted against quota
pr_test_*TestDevelopment and testing, relaxed rate limits

Authentication Header

Include your API key as a Bearer token in the Authorization header:

Authorization: Bearer pr_live_xxxxx

All requests must also include:

Content-Type: application/json

Create API Key

<div class="method-badge post">POST</div> `/v1/keys`

Creates a new API key. This is the signup endpoint — no prior authentication required.

Request Body

ParameterTypeRequiredDescription
emailstringYesAccount email address
namestringNoDisplay name for the account
vector_db_urlstringNoYour vector database instance URL. If omitted, overflow storage is available.

Code Examples

cURL

curl -X POST https://api.engrammemory.ai/v1/keys \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "name": "My App",
    "vector_db_url": "https://my-vectordb.example.com:6333"
  }'

Python

import requests

response = requests.post(
    "https://api.engrammemory.ai/v1/keys",
    json={
        "email": "[email protected]",
        "name": "My App",
        "vector_db_url": "https://my-vectordb.example.com:6333"
    }
)

data = response.json()
api_key = data["api_key"]

JavaScript

const response = await fetch("https://api.engrammemory.ai/v1/keys", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    email: "[email protected]",
    name: "My App",
    vector_db_url: "https://my-vectordb.example.com:6333"
  })
});

const data = await response.json();
const apiKey = data.api_key;

Response — 201 Created

{
  "api_key": "pr_live_a1b2c3d4e5f6...",
  "tier": "free",
  "vector_db_url": "https://my-vectordb.example.com:6333",
  "message": "API key created. Store this key securely — it cannot be retrieved again."
}

Errors

StatusCodeDescription
409EMAIL_EXISTSAn account with this email already exists
422VALIDATION_ERRORMissing or invalid fields

Check Usage

<div class="method-badge get">GET</div> `/v1/keys/usage`

Returns current usage metrics for the authenticated API key.

Authentication required.

Query Parameters

ParameterTypeRequiredDescription
detailedbooleanNoReturn per-endpoint breakdown. Default: false

Code Examples

cURL

curl -X GET "https://api.engrammemory.ai/v1/keys/usage?detailed=true" \
  -H "Authorization: Bearer pr_live_xxxxx"

Python

import requests

response = requests.get(
    "https://api.engrammemory.ai/v1/keys/usage",
    headers={"Authorization": "Bearer pr_live_xxxxx"},
    params={"detailed": "true"}
)

usage = response.json()
print(f"Used: {usage['requests_used']} / {usage['requests_limit']}")

JavaScript

const response = await fetch(
  "https://api.engrammemory.ai/v1/keys/usage?detailed=true",
  { headers: { "Authorization": "Bearer pr_live_xxxxx" } }
);

const usage = await response.json();
console.log(`Used: ${usage.requests_used} / ${usage.requests_limit}`);

Response — 200 OK

{
  "tier": "builder",
  "requests_used": 4821,
  "requests_limit": 50000,
  "memories_stored": 1200,
  "memories_limit": 100000,
  "reset_date": "2026-05-01T00:00:00Z",
  "detailed": {
    "intelligence": 3100,
    "store": 890,
    "search": 620,
    "embed": 211
  }
}

Errors

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid API key

Login (JWT)

<div class="method-badge post">POST</div> `/v1/auth/login`

Exchange an API key for a short-lived JWT token. Used by the Engram dashboard and client applications that need session-based authentication.

Request Body

ParameterTypeRequiredDescription
api_keystringYesYour Engram API key

Code Examples

cURL

curl -X POST https://api.engrammemory.ai/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "pr_live_xxxxx"
  }'

Python

import requests

response = requests.post(
    "https://api.engrammemory.ai/v1/auth/login",
    json={"api_key": "pr_live_xxxxx"}
)

data = response.json()
jwt_token = data["access_token"]

# Use JWT for subsequent dashboard requests
headers = {"Authorization": f"Bearer {jwt_token}"}

JavaScript

const response = await fetch("https://api.engrammemory.ai/v1/auth/login", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ api_key: "pr_live_xxxxx" })
});

const data = await response.json();
const jwtToken = data.access_token;

Response — 200 OK

{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "token_type": "bearer",
  "expires_in": 3600,
  "user": {
    "email": "[email protected]",
    "name": "My App",
    "tier": "builder",
    "created_at": "2026-03-15T08:30:00Z"
  }
}

Errors

StatusCodeDescription
401INVALID_API_KEYAPI key is invalid or revoked
422VALIDATION_ERRORMissing api_key field

Tier System

Engram offers four tiers with progressive limits:

FreeBuilderScaleEnterprise
Price$0/mo$29/mo$99/moCustom
Tokens / month100K2M25MUnlimited
Queries / month1K20K250KUnlimited
Compression vectors / month10K500K10MUnlimited
Collections1325Unlimited
Webhooks1525Unlimited
Deduplication--YesYesYes
Embedding dimensions768768768768
CompressionAdvancedAdvancedAdvancedAdvanced
SupportCommunityEmailPriorityDedicated

All tiers include the full intelligence pipeline: embedding, classification, deduplication, and compression. There are no feature gates — only volume limits.

Upgrading

Tier upgrades take effect immediately. Contact [email protected] for Enterprise pricing or to discuss custom limits.