API Documentation

Everything you need to integrate Seizn into your applications. Add persistent memory to your AI with just a few lines of code.

Quick Start

Get your API key from the dashboard, then start making requests:

bash
# Add a memory
curl -X POST https://seizn.com/api/memories \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "User prefers dark mode interfaces"}'

# Search memories
curl "https://seizn.com/api/memories?query=user+preferences" \
  -H "x-api-key: YOUR_API_KEY"

Authentication

All API requests require an API key passed in the x-api-key header.

bash
curl -H "x-api-key: szn_your_api_key_here" \
  https://seizn.com/api/memories?query=test

Security: Keep your API keys secret. Never expose them in client-side code. Use environment variables or a backend proxy.

API Endpoints

POST/api/memories

Add a new memory to the user's memory store.

Request Body

content-string (required) - The memory content
memory_type-string - Type: fact, preference, experience, relationship, instruction
tags-string[] - Tags for categorization
namespace-string - Namespace for organization (default: "default")
scope-string - Scope: user, session, agent
session_id-string - Session ID for session-scoped memories
agent_id-string - Agent ID for agent-scoped memories

Response

{
  "success": true,
  "memory": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "content": "User prefers dark mode interfaces",
    "memory_type": "preference",
    "tags": ["ui", "settings"],
    "namespace": "default",
    "created_at": "2026-01-08T10:30:00Z"
  }
}
GET/api/memories

Search memories using semantic similarity.

Query Parameters

query-string (required) - Search query
limit-number - Max results (default: 10, max: 100)
threshold-number - Similarity threshold 0-1 (default: 0.7)
namespace-string - Filter by namespace

Response

{
  "success": true,
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "content": "User prefers dark mode interfaces",
      "memory_type": "preference",
      "tags": ["ui", "settings"],
      "similarity": 0.89
    }
  ],
  "count": 1
}
DELETE/api/memories

Delete memories by their IDs.

Query Parameters

ids-string (required) - Comma-separated memory IDs

Response

{
  "success": true,
  "deleted": 3
}
POST/api/extract

Extract and store memories from a conversation using AI.

Request Body

conversation-string (required) - The conversation text to extract memories from
model-string - AI model: haiku (faster) or sonnet (better) (default: haiku)
auto_store-boolean - Automatically store extracted memories (default: true)
namespace-string - Namespace for stored memories (default: "default")

Response

{
  "message": "Extracted 3 memories, stored 3",
  "extracted": [
    {
      "content": "User is a software developer working with Python",
      "memory_type": "fact",
      "tags": ["profession", "programming"],
      "confidence": 0.95,
      "importance": 7
    }
  ],
  "stored": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "content": "User is a software developer working with Python",
      "memory_type": "fact",
      "created_at": "2026-01-08T10:30:00Z"
    }
  ]
}
POST/api/query

Get AI-generated responses using relevant memories as context (RAG).

Request Body

query-string (required) - The user's question or prompt
model-string - AI model: haiku or sonnet (default: haiku)
top_k-number - Number of memories to use as context (default: 5)
namespace-string - Filter memories by namespace
include_memories-boolean - Include used memories in response (default: true)

Response

{
  "response": "Based on your preferences, I'd recommend using VS Code with a dark theme since you prefer dark mode interfaces and work primarily with Python.",
  "memories_used": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "content": "User prefers dark mode interfaces",
      "similarity": 0.85
    },
    {
      "id": "661f9511-f3ac-52e5-b827-557766551111",
      "content": "User is a software developer working with Python",
      "similarity": 0.78
    }
  ],
  "model_used": "haiku"
}

Rate Limits

PlanDaily API CallsMax MemoriesAPI Keys
Free1,00010,0002
Plus10,000100,0005
Pro100,0001,000,00010
EnterpriseUnlimitedUnlimited100

When you exceed your rate limit, the API returns a 429 Too Many Requests response.

Error Codes

CodeDescription
200Success
400Bad Request - Missing or invalid parameters
401Unauthorized - Invalid or missing API key
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong

SDKs

Python

bash
pip install seizn
python
from seizn import Seizn

client = Seizn(api_key="your_api_key")

# Add memory
client.add("User prefers dark mode")

# Search
results = client.search("preferences")

# Extract from conversation
client.extract(conversation="...")

JavaScript

bash
npm install seizn
javascript
import { Seizn } from 'seizn';

const client = new Seizn({ apiKey: 'your_api_key' });

// Add memory
await client.add('User prefers dark mode');

// Search
const results = await client.search('preferences');

// Extract from conversation
await client.extract({ conversation: '...' });