API Quickstart
Get semantic memory running in under 60 seconds. No SDK required — just curl.
https://sendryx.polsia.appAll endpoints return JSON. Authenticated endpoints require an
X-API-Key header.
Authentication
Every Memory API request must include your API key. Two header formats are accepted:
X-API-Key: sk-gw-YOUR_KEY
# — or —
Authorization: Bearer sk-gw-YOUR_KEY
Keys are scoped to a namespace. All data you store is isolated to that namespace — no cross-tenant leakage.
Base URL
All API endpoints are relative to:
https://sendryx.polsia.app
Rate Limits
Rate limits are per API key, tracked with a sliding window.
| API | Per Minute | Per Hour |
|---|---|---|
| Memory API | 60 requests | 600 requests |
| Gateway API | 100 requests | 1,000 requests |
When you hit a limit, you'll get a 429 response with a Retry-After header:
{
"success": false,
"message": "Rate limit exceeded: 60 requests per minute",
"retry_after_seconds": 45
}
Create API Key
Generate an API key to authenticate all subsequent requests. Each key is scoped to the namespace you provide.
curl -X POST https://sendryx.polsia.app/v1/keys \
-H "Content-Type: application/json" \
-d '{
"namespace": "my-agent",
"name": "production-key"
}'
| Field | Type | Required | Description |
|---|---|---|---|
namespace | string | Yes | Tenant namespace for data isolation |
name | string | No | Human-readable label |
{
"success": true,
"key": {
"id": 1,
"key": "sk-gw-abc123...",
"namespace": "my-agent",
"name": "production-key",
"created_at": "2026-04-06T12:00:00.000Z"
}
}
Store a Memory
Store text with automatic vector embedding. Optionally attach metadata and set a TTL.
curl -X POST https://sendryx.polsia.app/v1/memory/store \
-H "Content-Type: application/json" \
-H "X-API-Key: sk-gw-YOUR_KEY" \
-d '{
"content": "User prefers dark mode and metric units",
"metadata": { "source": "onboarding", "user_id": "u_42" },
"expires_in_seconds": 86400
}'
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Text to store (max 8,191 chars). Auto-embedded. |
metadata | object | No | Custom JSON metadata stored alongside the memory |
expires_in_seconds | number | No | Auto-delete after N seconds. Omit for permanent storage. |
{
"success": true,
"memory": {
"id": 42,
"namespace": "my-agent",
"content": "User prefers dark mode and metric units",
"metadata": { "source": "onboarding", "user_id": "u_42" },
"created_at": "2026-04-06T12:01:00.000Z",
"expires_at": "2026-04-07T12:01:00.000Z"
}
}
Semantic Search
Find memories by meaning, not keywords. Uses cosine similarity over 1536-dim embeddings.
curl "https://sendryx.polsia.app/v1/memory/search?query=user+preferences&limit=5&threshold=0.3" \
-H "X-API-Key: sk-gw-YOUR_KEY"
| Param | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Natural language search query |
limit | number | No | Max results (default: 10, max: 100) |
threshold | number | No | Min similarity 0-1 (default: 0.3) |
{
"success": true,
"query": "user preferences",
"results": [
{
"id": 42,
"namespace": "my-agent",
"content": "User prefers dark mode and metric units",
"metadata": { "source": "onboarding", "user_id": "u_42" },
"similarity": 0.92
}
],
"count": 1
}
List Memories
Paginate through all memories in your namespace.
curl "https://sendryx.polsia.app/v1/memory/list?limit=20&offset=0" \
-H "X-API-Key: sk-gw-YOUR_KEY"
| Param | Type | Required | Description |
|---|---|---|---|
limit | number | No | Results per page (default: 50, max: 200) |
offset | number | No | Skip N results (default: 0) |
include_expired | string | No | Set to "true" to include expired memories |
{
"success": true,
"namespace": "my-agent",
"memories": [
{
"id": 42,
"namespace": "my-agent",
"content": "User prefers dark mode and metric units",
"metadata": { "source": "onboarding" },
"created_at": "2026-04-06T12:01:00.000Z",
"expires_at": "2026-04-07T12:01:00.000Z"
}
],
"total": 1,
"limit": 20,
"offset": 0
}
Get Namespace Stats
Quick overview of memory usage for your namespace.
curl "https://sendryx.polsia.app/v1/memory/stats" \
-H "X-API-Key: sk-gw-YOUR_KEY"
{
"success": true,
"namespace": "my-agent",
"stats": {
"total_memories": 150,
"active_ttl": 45,
"permanent": 105,
"expired": 0,
"oldest_at": "2026-01-01T00:00:00.000Z",
"newest_at": "2026-04-06T12:01:00.000Z"
}
}
Delete Memory
Delete a specific memory by ID, or wipe your entire namespace.
Delete by ID
curl -X DELETE https://sendryx.polsia.app/v1/memory/forget \
-H "Content-Type: application/json" \
-H "X-API-Key: sk-gw-YOUR_KEY" \
-d '{ "id": 42 }'
{
"success": true,
"deleted": 1,
"message": "Memory 42 deleted"
}
Wipe Namespace
curl -X DELETE https://sendryx.polsia.app/v1/memory/forget \
-H "Content-Type: application/json" \
-H "X-API-Key: sk-gw-YOUR_KEY" \
-d '{ "wipe": true }'
{
"success": true,
"deleted": 150,
"message": "Namespace wiped"
}
| Field | Type | Required | Description |
|---|---|---|---|
id | number | One of | ID of the memory to delete |
wipe | boolean | One of | Set to true to delete all memories in namespace |
Error Codes
All errors follow a consistent JSON format with an HTTP status code.
| Status | Meaning | Common Cause |
|---|---|---|
| 400 | Bad Request | Missing required field (content, query, etc.) |
| 401 | Unauthorized | Missing or invalid API key |
| 404 | Not Found | Memory ID doesn't exist or belongs to another namespace |
| 429 | Rate Limited | Too many requests — check Retry-After header |
| 500 | Server Error | Internal issue — retry or contact support |
{
"success": false,
"message": "API key required. Use Authorization: Bearer <key> or X-API-Key: <key>"
}
Response Format
Every response includes a success boolean at the top level.
// Success
{ "success": true, ...data }
// Error
{ "success": false, "message": "What went wrong" }
All timestamps are ISO 8601 in UTC. All request/response bodies are application/json.
Need help? support@polsia.com