Skip to main content
All routes require Authorization: Bearer ltx_your_key (same key as search). Each agent only sees its own keys; storage is namespaced by agent id server-side.

Endpoints

Store or update (PUT)

Key rules

  • Path segment {key}: 1–128 characters, charset [a-zA-Z0-9-_.:]
  • Invalid charset or length returns 422 with MEMORY_KEY_INVALID. Do not embed raw / in the segment (use . or : for namespaces). A URL-encoded slash in one segment may match no route and return 404 before key validation.
  • Reserved: GET /v1/memory/context is a fixed route for context reload. A memory key literally named context cannot be read with GET /v1/memory/context as “get by key” — that path always runs the context handler. Use GET /v1/memory (list) or GET /v1/memory/search if you need to locate such a key after storing it.

List keys (GET /v1/memory)

Query parameters: page (default 1), per_page (1–100, default 50), optional prefix, optional importance. Returns metadata only (key, sizes, timestamps, provenance fields) — not full values.

Stats (GET /v1/memory/stats)

Read-only: memory ops used/remaining, storage bytes, tier label, and over_limit.

Context reload (GET /v1/memory/context)

Query: limit (1–50, default 10), optional importance floor (critical | high | normal | low). Returns top entries ranked by importance then recency — useful after a cold start. This is not semantic/vector search.

Semantic search (GET /v1/memory/search)

Query (authenticated): Returns ranked hits with similarity (0–1), full value, and provenance fields. Requires OpenAI (embeddings) and Upstash Vector on the host; otherwise the API responds with 503 and MEMORY_SEARCH_UNAVAILABLE. Each successful call counts as one memory operation toward your tier limits. Empty or whitespace q yields 422 MEMORY_QUERY_REQUIRED.

Response shape

Successful responses include a usage object (memory ops and storage vs tier). Exact fields match the live OpenAPI schema at /openapi.json.

Common errors

For discovery metadata without auth, use GET /v1/capabilities and the agent guide.