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.