Skip to content

API

API Examples

Use the local daemon HTTP API from scripts when the CLI or MCP tools are not the right fit.

Qi-Xuan LuUpdated 6 min read

At a glance

01

The HTTP API is local to the daemon on 127.0.0.1:7878. It is useful for scripts, diagnostics, and first-party clients.

02

For normal workflows, prefer Claude Code slash commands, MCP tools, or the CLI. They carry Origin's current product semantics better than hand-written HTTP calls.

01

Before using curl

Start with the CLI or MCP connector unless you specifically need local script automation. The daemon API is the local contract underneath those tools, not a hosted SDK surface.

Keep calls on 127.0.0.1 unless you intentionally changed ORIGIN_BIND_ADDR. Exposing the daemon beyond loopback changes the security boundary.

Read HTTP API overview

02

Health and setup

Use health and status endpoints before testing memory calls. They separate daemon reachability from search, capture, or MCP-client problems.

setup/status is useful when a client reports that Origin is installed but tools still fail.

Health checks

curl -s http://127.0.0.1:7878/api/health
curl -s http://127.0.0.1:7878/api/status
curl -s http://127.0.0.1:7878/api/setup/status

03

Store and search memory

memory/store accepts a complete memory statement plus optional memory_type, source_agent, space, supersedes, entity, structured_fields, and retrieval_cue fields.

memory/search accepts query, limit, optional memory_type, optional space, optional source_agent, and rerank. rerank only changes ordering when the daemon has a reranker configured.

Memory calls

curl -s -X POST http://127.0.0.1:7878/api/memory/store \
  -H 'content-type: application/json' \
  -d '{
    "content": "We chose spaces for client separation because context bleed is risky.",
    "memory_type": "decision",
    "source_agent": "local-script",
    "space": "work"
  }'

curl -s -X POST http://127.0.0.1:7878/api/memory/search \
  -H 'content-type: application/json' \
  -d '{
    "query": "client separation decision",
    "limit": 5,
    "space": "work",
    "rerank": false
  }'

04

Load context for a session

chat-context is the daemon route behind broad session orientation. It returns a context string plus structured knowledge fields for clients that need them.

Use this when a local tool needs a compact context bundle. For specific facts, search memory instead.

Context call

curl -s -X POST http://127.0.0.1:7878/api/chat-context \
  -H 'content-type: application/json' \
  -d '{
    "query": "origin website docs",
    "max_chunks": 8,
    "space": "work"
  }'

05

Review and confirm

memory/list can filter unconfirmed memories with confirmed=false. memory/confirm/{source_id} confirms or unconfirms one item.

This is useful for a local review UI or a diagnostic script. In normal agent work, prefer /review or the MCP review tools when available.

Review calls

curl -s -X POST http://127.0.0.1:7878/api/memory/list \
  -H 'content-type: application/json' \
  -d '{ "confirmed": false, "limit": 10 }'

curl -s -X POST http://127.0.0.1:7878/api/memory/confirm/mem_abc123 \
  -H 'content-type: application/json' \
  -d '{ "confirmed": true }'

06

Search pages

pages/search looks over source-backed pages. A page result is different from an atomic memory result: it is synthesized from source memories and should preserve provenance.

Use pages/{id}/sources when you need to inspect which memories produced a page before trusting or editing it.

Page calls

curl -s -X POST http://127.0.0.1:7878/api/pages/search \
  -H 'content-type: application/json' \
  -d '{ "query": "distillation architecture", "limit": 5 }'

curl -s http://127.0.0.1:7878/api/pages/page_abc123/sources

07

Build typed clients carefully

Rust integrations should prefer origin-types for request and response shapes. That keeps shape drift visible at compile time instead of passing untyped JSON through local tools.

For non-Rust scripts, keep bodies small, handle non-200 responses, and avoid destructive delete/update routes unless you have a backup and a clear source_id.

Read package names

Next

Typed Clients

Use origin-types when a Rust tool needs to call the local daemon without relying on untyped JSON shapes.

Read next