Seizn.

API文檔

將Seizn整合到您的應用程式所需的一切。只需幾行程式碼即可為您的AI添加持久記憶。

快速入門

從儀表板獲取您的API密鑰 儀表板,然後開始發送請求:

bash
# Add a memory
curl -X POST https://seizn.com/api/memories \
  -H "Authorization: Bearer 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 "Authorization: Bearer YOUR_API_KEY"

認證

所有API請求都需要在 x-api-key 標頭中傳遞API密鑰。

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

安全: 請妥善保管您的API密鑰。不要在客戶端程式碼中暴露它們。使用環境變數或後端代理。

API端點

POST/api/memories

向用戶的記憶儲存添加新記憶。

請求體

content-string (required)
memory_type-string - fact, preference, experience, relationship, instruction
tags-string[]
namespace-string (default: "default")
scope-string - user, session, agent
session_id-string
agent_id-string

回應

{
  "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

使用語義相似性搜索記憶。

查詢參數

query-string (required)
limit-number (default: 10, max: 100)
threshold-number 0-1 (default: 0.7)
namespace-string

回應

{
  "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

按ID刪除記憶。

查詢參數

ids-string (required) - comma-separated

回應

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

使用AI從對話中提取並儲存記憶。

請求體

conversation-string (required)
model-string - haiku | sonnet (default: haiku)
auto_store-boolean (default: true)
namespace-string (default: "default")

回應

{
  "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": [...]
}
POST/api/query

使用相關記憶作為上下文獲取AI生成的回應(RAG)。

請求體

query-string (required)
model-string - haiku | sonnet (default: haiku)
top_k-number (default: 5)
namespace-string
include_memories-boolean (default: true)

回應

{
  "response": "Based on your preferences, I'd recommend using VS Code with a dark theme...",
  "memories_used": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "content": "User prefers dark mode interfaces",
      "similarity": 0.85
    }
  ],
  "model_used": "haiku"
}

速率限制

方案Monthly API Calls最大記憶數API密鑰
免費1,0001002
Starter50,0005,0003
Plus500,00050,0005
Pro2,000,000無限10
企業版無限無限100

當您超過速率限制時,API將返回 429 Too Many Requests 回應。

錯誤代碼

代碼描述
200成功
400錯誤請求 - 缺少參數或參數無效
401未授權 - API密鑰無效或缺失
429請求過多 - 超過速率限制
500內部伺服器錯誤 - 出現問題

安全與治理

數據安全

  • 靜態加密: 所有數據使用AES-256加密
  • 傳輸加密: 所有連接使用TLS 1.3
  • 租戶隔離: 帳戶間完全數據隔離

API密鑰管理

  • 密鑰輪換: 隨時從儀表板輪換密鑰
  • 密鑰過期: 90天後自動過期(可配置)
  • 使用追蹤: 即時監控每個密鑰的使用情況

數據保留與刪除

  • 導出: 隨時通過API或儀表板導出所有數據
  • 刪除: 30天後永久刪除,不保留
  • GDPR/CCPA: 完全符合數據主體權利

SDK

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: '...' });

MCP Server — Every Editor, One Memory

The Seizn MCP Server (seizn-mcp) bridges your Seizn memories to AI coding assistants via the Model Context Protocol. 40+ tools, MCP Resources, webhooks, OAuth device flow, and multi-editor config sync — all in one package.

bash
# Install globally or use npx
npx seizn-mcp@latest

# Or add to Claude Code settings (~/.claude/settings.json)
{
  "mcpServers": {
    "seizn": {
      "command": "npx",
      "args": ["-y", "seizn-mcp@latest"],
      "env": { "SEIZN_API_KEY": "your-api-key" }
    }
  }
}

Supported Editors

  • > Claude Code — native MCP
  • > Cursor — native MCP
  • > Windsurf — native MCP
  • > Cline — native MCP
  • ~ GitHub Copilot — via config sync
  • ~ Aider — via config sync
  • ~ OpenAI Codex — via config sync

Key Features

  • > 40+ MCP Tools — memories, knowledge graph, profile, webhooks, config sync
  • > MCP Resources — seizn://memories/recent, seizn://profile, seizn://context/{format}
  • > OAuth Device Flow — browser auth, no API key copy
  • > Auto Context — detects project from package.json, pyproject.toml, Cargo.toml
  • > UTF-8 Support — Korean, Japanese, Chinese, Arabic and 100+ languages

Multi-Editor Config Sync

Seizn exports your memories as editor-specific configuration files. Your AI preferences follow you across every tool.

FileAI ToolMethod
CLAUDE.mdClaude CodeMCP + File
AGENTS.mdOpenAI CodexFile Sync
.cursor/rulesCursorMCP + File
.windsurfrulesWindsurfMCP + File
.github/copilot-instructions.mdGitHub CopilotFile Sync
.clinerulesClineMCP + File
CONVENTIONS.mdAiderFile Sync

OAuth Device Flow

No more copying API keys. The MCP server supports RFC 8628 Device Authorization Grant for browser-based authentication.

1

Run auth_login tool

2

Enter code ABCD-1234 in browser

3

Token saved to ~/.seizn/

Zero-copy auth: The device flow generates a human-readable code, opens your browser, and saves credentials automatically. Works with any terminal or SSH session.