Skip to main content

Authentication

All memory endpoints (prefixed /v1/) require an API key in the Authorization header:
The key is extracted and validated on every request. If invalid or missing:
The API key determines the workspace — all responses are scoped to that workspace automatically.

Memory endpoints

All memory endpoints are namespaced under /v1/ and require a valid API key.

POST /v1/remember

Write to all three memory layers.
str
required
Agent identifier.
str
required
Memory content (1–8000 characters).
float
Importance score (0.0–1.0). Default: 0.5.
dict[str, Any]
Custom metadata dictionary.
object

POST /v1/recall

Search across all three layers and return ranked results.
str
required
Agent identifier.
str
required
Search query (1–500 characters).
int
Maximum results (1–100). Default: 10.
list[str]
Filter to layers: “working”, “episodic”, “semantic”. Default: all three.
object

POST /v1/context

Build a token-budgeted context string.
str
required
Agent identifier.
str
required
Search query.
int
Maximum tokens. Default: 2048.
object

GET /v1/stats

Get memory statistics for the current workspace.
object

DELETE /v1/memory

Clear all working memory for an agent.
str
required
Agent identifier.
object

Admin endpoints

Admin endpoints require PLYRA_ADMIN_API_KEY instead of a regular API key.

POST /admin/keys

Create a new API key.
str
required
Workspace identifier.
str
required
Human-readable label for this key.
str
Environment: “live” or “test”. Default: “live”.
object
The key field is returned only once. It is hashed server-side and cannot be retrieved again.

GET /admin/keys/

List all keys for a workspace.
array

DELETE /admin/keys/

Revoke an API key. Revocation is instant.
object

Health endpoint

GET /health

Server health and version info. No authentication required.
object

Error responses

All errors return JSON with a detail field and appropriate HTTP status: Example error: