API Overview
The Tensorheart Memory API is a RESTful API that uses JSON for requests and responses.
Base URL
https://api.memory.tensorheart.com/v1
Authentication
Include your API key in every request:
Authorization: Bearer mem_live_your_api_key
Endpoints Summary
Memories
| Method | Endpoint | Description |
|---|---|---|
POST | /memories | Create a memory |
GET | /memories | List memories |
GET | /memories/{id} | Get a memory |
PUT | /memories/{id} | Update a memory |
DELETE | /memories/{id} | Delete a memory |
POST | /memories/consolidate | Merge similar memories |
Memory Spaces
| Method | Endpoint | Description |
|---|---|---|
POST | /spaces | Create a space |
GET | /spaces | List spaces |
GET | /spaces/{id} | Get a space |
PUT | /spaces/{id} | Update a space |
DELETE | /spaces/{id} | Delete a space |
Query & Retrieval
| Method | Endpoint | Description |
|---|---|---|
POST | /query | Find relevant memories |
POST | /query/answer | Query with AI answer |
POST | /query/extract | Extract memories from text |
Transparent Proxy
| Method | Endpoint | Description |
|---|---|---|
POST | /proxy/{url} | Proxy LLM request with memory |
Context Extension
| Method | Endpoint | Description |
|---|---|---|
POST | /chat/sessions | Create chat session |
POST | /chat/sessions/{id}/messages | Send message |
GET | /chat/sessions/{id}/context | Get optimized context |
GET | /chat/sessions | List sessions |
Document Ingestion
| Method | Endpoint | Description |
|---|---|---|
POST | /ingest/file | Upload and process file |
POST | /ingest/url | Ingest from URL |
GET | /ingest/{id} | Get document status |
GET | /ingest | List documents |
Tool Call Tracking
| Method | Endpoint | Description |
|---|---|---|
POST | /tools/calls | Record tool call |
GET | /tools/calls | List tool calls |
GET | /tools/summary | Usage summary |
Account
| Method | Endpoint | Description |
|---|---|---|
GET | /account | Get account details |
GET | /account/api-keys | List API keys |
POST | /account/api-keys | Create API key |
DELETE | /account/api-keys/{id} | Revoke API key |
Usage
| Method | Endpoint | Description |
|---|---|---|
GET | /usage | Current usage |
GET | /usage/history | Historical usage |
GET | /usage/projection | Projected usage |
Response Format
Success Response
{
"success": true,
"data": { ... },
"meta": {
"request_id": "req_abc123",
"processing_time_ms": 45
}
}
Error Response
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable message"
}
}
Rate Limit Headers
Every response includes:
X-RateLimit-Limit: Your limitX-RateLimit-Remaining: Remaining requestsX-RateLimit-Reset: Reset timestamp
Pagination
List endpoints support pagination:
GET /v1/memories?page=1&per_page=50
Response includes:
{
"pagination": {
"total": 150,
"page": 1,
"per_page": 50,
"total_pages": 3,
"has_next": true
}
}