awe docs

For developers

Core API

awe’s engine serves a local HTTP API on port 8766. The console uses it, and so can your own scripts: recall memory, record a conversation turn from another app, list and call tools, manage scheduled tasks, hooks and automations. This page is for developers.

It is separate from the OpenAI-compatible API on port 8765, which is for chat.

Address and sign-in

Base URL http://127.0.0.1:8766
Reachable from This computer only. The address and port are fixed
Served by The awe background service. If awe is not running, nothing answers
Token The contents of .awe/console.token in your awe folder

The token is created the first time awe starts, and the file is readable only by you. Send it on every request except the two public ones:

Authorization: Bearer <token>

A missing or wrong token gets 401 with {"ok": false, "error": "unauthorized"}.

TOKEN=$(cat .awe/console.token)
curl -s http://127.0.0.1:8766/health
curl -s http://127.0.0.1:8766/api/servers -H "Authorization: Bearer $TOKEN"

Treat the token like a password. Anything that holds it can call your tools.

The OpenAPI document

The engine describes its own routes. No token is needed:

curl -s http://127.0.0.1:8766/openapi.json

That document has the request and response schema for each route, and is the reference to build against. The tables below are a map.

Routes

Public:

Method and path Returns
GET /health {"ok": true, "service": "awe-core", "version": "<awe version>"}
GET /openapi.json The OpenAPI document

Memory and conversation turns:

Method and path What it does
POST /api/v2/memory/recall Search memory. See below
POST /api/v2/channels/turns Record one conversation turn from another app. See below
POST /api/memory/search The older search route. Still works, and answers with Deprecation and Sunset headers that point to the v2 route. Use v2 for new work
POST /api/intents/analyze Body {"query": "..."}. Reports how awe would route a request
POST /api/brain/execute Body {"query": "..."}. Runs a request through awe’s router. Needs a connected account

Servers and tools:

Method and path What it does
GET /api/servers List MCP servers
POST /api/servers Register a server
DELETE /api/servers/:name Remove a server
PATCH /api/servers/:name/active Body {"active": true} or false. Turn a server on or off
GET /api/routing/stats Tool routing statistics
GET /api/tools List tools. ?server=<name> for one server, ?search=<text> to search
GET /api/tools/:tool_name/schema The arguments a tool takes
POST /api/tools/call Call a tool. See below

Sign-in for remote servers:

Method and path What it does
GET /api/oauth/status Sign-in state per server
POST /api/oauth/credentials Save a key
POST /api/oauth/start, GET /api/oauth/callback Run a browser sign-in
POST /api/oauth/revoke Disconnect
POST /api/oauth/switch-account Sign in as a different account

Schedule, hooks and automations:

Method and path What it does
GET /api/schedule List scheduled tasks
POST /api/schedule Add a task. See below
DELETE /api/schedule/:id Remove a task
GET /api/hooks List lifecycle hooks. ?event=PreToolUse filters
POST /api/hooks Add a hook
DELETE /api/hooks/:id Remove a hook
POST /api/hooks/:id/toggle Body {"enabled": true} or false
GET /api/automations, POST /api/automations List and create automations
GET, PATCH, DELETE /api/automations/:id Read, change, delete one
POST /api/automations/:id/run Run one now
POST /api/automations/:id/reset-state Clear what an automation remembers about past runs

Successful answers are wrapped as {"ok": true, "data": {...}}. Failures are {"ok": false, "error": "..."}.

Recall memory

curl -s -X POST http://127.0.0.1:8766/api/v2/memory/recall \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"query": "launch date decision", "k": 5}'
Field Default Notes
query required An empty query gets 400
k 5 How many results
scope_filter all "all", or {"surfaces": ["slack"]}, or {"conversation_id": "..."}. With surfaces, only the first entry is used
project none A project id. Facts that belong to other projects are left out. Facts with no project are always included
principal_id none Limit to one person’s memory
provenance true Include where each fact came from
max_age_secs, include_unverified, tenant_id Optional. See the OpenAPI document

The answer’s data holds:

  • items: each has chunk_id, text, path, score, and when known chunk_tag, chunk_scope, surface and provenance_scope.
  • latency_ms: how long the search took.
  • slo_state and fallback_path: reserved. Today they are always "warm" and null.

Record a turn from another app

This is how a channel or integration tells awe “this was said here”, so that awe can remember it and recall it from other places.

curl -s -X POST http://127.0.0.1:8766/api/v2/channels/turns \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{
    "principal_id": "<your principal id>",
    "surface": "cli",
    "role": "user",
    "content": "Remember that the demo moved to Thursday."
  }'
Field Required Notes
principal_id Yes Who said it. List yours with ./awe-core continuity list-principals
surface Yes Where it was said. One of the names below
role Yes user, assistant, tool or system
content Yes The text
conversation_id No Defaults to one conversation per surface
occurred_at No An RFC 3339 time. Defaults to now
surface_external_id No The message’s id in the other app

Surface names: web, telegram, slack, discord, whatsapp, imessage, googlechat, teams, signal, voice, email, calendar, zoho, cli, cursor-hook, claude-code-hook, codex, gemini, aider, open-interpreter, zed, continue-dev, jetbrains, mcp-host, subagent, automation, skill-console.

The answer’s data holds gateway_message_id, principal_id, conversation_id and recorded_at_ms. An unknown surface or role gets 400. If the console’s database does not exist yet, the answer is 503.

Call a tool

curl -s "http://127.0.0.1:8766/api/tools?search=cpu" -H "Authorization: Bearer $TOKEN"

curl -s -X POST http://127.0.0.1:8766/api/tools/call \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"server": "mcp-monitor", "tool": "get_cpu_info", "args": {}}'

The answer’s data holds the tool’s result and duration_ms. This route calls the tool directly. It does not ask you first, so do not expose it to anything you do not trust.

Add a scheduled task

curl -s -X POST http://127.0.0.1:8766/api/schedule \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{
    "name": "morning-summary",
    "schedule": "0 8 * * *",
    "schedule_type": "cron",
    "payload_type": "query",
    "payload": "summarise my unread email"
  }'
Field Notes
schedule_type cron, every, at or in
schedule Matches the type: a cron line, 1h-style interval, 09:00, or 4h
payload_type, payload What to run. query runs a plain request. See awe-scheduler.md for the other kinds
one_shot true to delete the task after its first run
timezone An IANA zone name when the time belongs to a place, for example Europe/London. Leave it out to use your own clock
next_run_at Optional. awe works it out from the schedule when you leave it out

The command line does the same: ./awe-core schedule add, ./awe-core schedule list, ./awe-core schedule remove.

Typed client for TypeScript

In the open-source console code, npm run gen:core-api (in MCP-servers/awe-console) reads /openapi.json from a running awe and writes TypeScript types for every route. The console’s own client is built on those types.