API Quickstart

Get semantic memory running in under 60 seconds. No SDK required — just curl.

Base URL: https://sendryx.polsia.app
All 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.

APIPer MinutePer Hour
Memory API60 requests600 requests
Gateway API100 requests1,000 requests

When you hit a limit, you'll get a 429 response with a Retry-After header:

429 Too Many Requests
{
  "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.

POST /v1/keys
curl -X POST https://sendryx.polsia.app/v1/keys \
  -H "Content-Type: application/json" \
  -d '{
    "namespace": "my-agent",
    "name": "production-key"
  }'
FieldTypeRequiredDescription
namespacestringYesTenant namespace for data isolation
namestringNoHuman-readable label
Response 200
{
  "success": true,
  "key": {
    "id": 1,
    "key": "sk-gw-abc123...",
    "namespace": "my-agent",
    "name": "production-key",
    "created_at": "2026-04-06T12:00:00.000Z"
  }
}
Save your key. The full key is only returned once at creation time. Store it securely — you'll need it for every authenticated request.

Store a Memory

Store text with automatic vector embedding. Optionally attach metadata and set a TTL.

POST /v1/memory/store
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
  }'
FieldTypeRequiredDescription
contentstringYesText to store (max 8,191 chars). Auto-embedded.
metadataobjectNoCustom JSON metadata stored alongside the memory
expires_in_secondsnumberNoAuto-delete after N seconds. Omit for permanent storage.
Response 200
{
  "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"
  }
}

Find memories by meaning, not keywords. Uses cosine similarity over 1536-dim embeddings.

GET /v1/memory/search
curl "https://sendryx.polsia.app/v1/memory/search?query=user+preferences&limit=5&threshold=0.3" \
  -H "X-API-Key: sk-gw-YOUR_KEY"
ParamTypeRequiredDescription
querystringYesNatural language search query
limitnumberNoMax results (default: 10, max: 100)
thresholdnumberNoMin similarity 0-1 (default: 0.3)
Response 200
{
  "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.

GET /v1/memory/list
curl "https://sendryx.polsia.app/v1/memory/list?limit=20&offset=0" \
  -H "X-API-Key: sk-gw-YOUR_KEY"
ParamTypeRequiredDescription
limitnumberNoResults per page (default: 50, max: 200)
offsetnumberNoSkip N results (default: 0)
include_expiredstringNoSet to "true" to include expired memories
Response 200
{
  "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.

GET /v1/memory/stats
curl "https://sendryx.polsia.app/v1/memory/stats" \
  -H "X-API-Key: sk-gw-YOUR_KEY"
Response 200
{
  "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

DELETE /v1/memory/forget
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 }'
Response 200
{
  "success": true,
  "deleted": 1,
  "message": "Memory 42 deleted"
}

Wipe Namespace

DELETE /v1/memory/forget
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 }'
Response 200
{
  "success": true,
  "deleted": 150,
  "message": "Namespace wiped"
}
FieldTypeRequiredDescription
idnumberOne ofID of the memory to delete
wipebooleanOne ofSet to true to delete all memories in namespace

Error Codes

All errors follow a consistent JSON format with an HTTP status code.

StatusMeaningCommon 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
Error response example
{
  "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