Neura API
External brain for AI agents — persistent memory and state via HTTP. Designed so agents can use it without human help.
Authentication
All requests require this header. Generate API keys via the dashboard.
Endpoints
/api/memoryStore Memory
Store a fact with auto-embedding via OpenAI. The content is vectorized and indexed for semantic search.
{
"content": "User prefers dark mode in all apps",
"tags": ["preference", "ui"],
"importance": 8,
"metadata": { "source": "conversation" }
}{
"data": {
"id": "uuid",
"content": "...",
"tags": ["preference", "ui"],
"importance": 8,
"created_at": "2026-05-14T..."
}
}/api/memory?query=...&limit=10Search Memories
Semantic search. Returns memories ranked by cosine similarity (0-1). Omitting query returns most recent.
{
"data": [
{
"id": "uuid",
"content": "...",
"score": 0.92,
"tags": ["preference"],
"created_at": "2026-05-14T..."
}
],
"meta": { "total": 5, "query": "..." }
}/api/memory/searchAdvanced Search
Filter by tags, importance, date range, and metadata. Give agents precision control.
{
"query": "user preferences",
"filters": {
"tags": ["preference"],
"importance_min": 5,
"date_from": "2026-01-01"
},
"limit": 20,
"min_score": 0.5
}{
"data": [...],
"meta": { "total": 12 }
}/api/memory/:idUpdate Memory
Update fields. Content changes auto-regenerate the embedding.
{ "importance": 9 }{ "data": { ... } }/api/memory/:idDelete Memory
Remove a memory permanently.
{ "data": { "id": "uuid", "deleted": true } }/api/stateSet State
Persistent key-value storage. Survives context loss. Use for goals, settings, flags.
{
"key": "current_goal",
"value": { "task": "Build API", "priority": "high" }
}{ "data": { "key": "current_goal", "value": {...}, "updated_at": "..." } }/api/state/:keyGet State
Retrieve a single value by key. Returns 404 if key doesn't exist.
{ "data": { "key": "current_goal", "value": {...} } }/api/stateList State
Return all state entries for this agent.
{ "data": [{ "key": "...", "value": ... }] }/api/state/:keyDelete State
Remove a state entry.
{ "data": { "key": "...", "deleted": true } }Error Format
Every error is machine-readable. Agents use the code and action fields to self-heal.
{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded",
"action": "wait_and_retry",
"retry_after": 5,
"docs_url": "https://neura.sh/docs/..."
}
}| Code | Status | Agent Action |
|---|---|---|
| unauthorized | 401 | provide_valid_api_key |
| validation_error | 400 | fix_request_body |
| not_found | 404 | check_resource_id |
| rate_limited | 429 | wait_and_retry |
| payment_required | 402 | send_payment |
| internal_error | 500 | retry |
Rate Limiting
100 requests per 60 seconds per API key. Exceeded requests return 429.
X-RateLimit-Limit — max requests per window
X-RateLimit-Remaining — requests left in window
Retry-After — seconds to wait on 429
Idempotency
POST and PATCH endpoints accept an Idempotency-Key header. If a request is retried with the same key, the original response is returned. Cached for 24 hours. Use this for safe retries.
SDKs
TypeScript
import { Neura } from 'neura-api'
const neura = new Neura({ apiKey: 'sk-...' })
await neura.memory.create({ content: '...' })
const r = await neura.memory.search('...')0 deps, ESM + CJS, auto-retry
npm install neura-api
Python
from neura import Neura
neura = Neura(api_key="sk-...")
neura.memory.create(content="...")
r = neura.memory.search("...")0 deps, stdlib only, auto-retry
pip install neura-api