OPTXOPTX DOCS
JOE — Jett Optics Engine

Hermes OPTX API

751510

Enhanced API bridge for Hermes Agent — SSE streaming chat, pluggable memory, task orchestration, Tempo wallet billing.

The Hermes OPTX API is a FastAPI sidecar that extends Hermes Agent with enhanced endpoints for JettChat and Hermes Workspace. Open source at joe-optx-hermes-api.

Why It Exists

JettChat and Hermes Workspace expect /api/sessions, /api/skills, /api/memory, /api/config, and SSE streaming chat endpoints that upstream Hermes Agent doesn't provide. Rather than forking the agent, the Hermes OPTX API sits alongside it as a sidecar — extending capabilities without modifying the core.

Architecture

Hermes OPTX API Architecture — JettChat to API sidecar to Hermes Agent with all endpoint routes
Hermes OPTX API v0.3.0 Architecture

SSE Streaming Chat

The primary integration point for JettChat. Sends a user message to Hermes Agent and streams the response as Server-Sent Events.

New Session + Stream (One Call)

curl -N -X POST http://localhost:8643/api/sessions/new/chat/stream \
  -H "Content-Type: application/json" \
  -d '{"message": "What is OPTX?"}'

Stream Into Existing Session

curl -N -X POST http://localhost:8643/api/sessions/abc123/chat/stream \
  -H "Content-Type: application/json" \
  -d '{"message": "Tell me more", "model": "grok-4.20-0309-reasoning"}'

SSE Event Format

EventDataDescription
session{session_id, status}Session created or opened
content{content, session_id}Token chunk
done{session_id, status}Stream complete
error{error, session_id}Error occurred

The stream auto-falls back from the Hermes session API to /v1/chat/completions if the upstream doesn't support session-scoped chat.

Gateway Capability Probing

At startup, the API probes the upstream Hermes Agent and exposes detected capabilities at /api/gateway-status:

{
  "status": "connected",
  "mode": "enhanced-hermes",
  "model": "grok-4.20-0309-reasoning",
  "version": "0.3.0",
  "features": {
    "sessions": true,
    "streaming": true,
    "chat_stream": true,
    "memory": true,
    "tasks": true,
    "wallet": true,
    "mcp_servers": true,
    "tempo_billing": true
  }
}
ModeDescription
enhanced-hermesFull Hermes Agent gateway with all features
portableBasic gateway, limited feature set
disconnectedUpstream unreachable, local-only features still work

Endpoints

Sessions

MethodPathDescription
GET/api/sessionsList all sessions
GET/api/sessions/{id}Get session details
GET/api/sessions/{id}/messagesGet session messages
POST/api/sessions/{id}/chat/streamSSE streaming chat
POST/api/sessions/new/chat/streamCreate session + stream
DELETE/api/sessions/{id}Delete a session

Skills

MethodPathDescription
GET/api/skillsList all skills (with category/search filtering)

Memory

MethodPathDescription
POST/api/memoryStore a memory
POST/api/memory/searchSearch memories with filters
GET/api/memoryList all memories
GET/api/memory/recallQuick recall (GET-based search)
DELETE/api/memory/{id}Delete a memory
GET/api/memory/statsMemory statistics + health

Config

MethodPathDescription
GET/api/configRead config (sensitive values redacted)
POST/api/configUpdate config with dot-notation keys
GET/api/config/modelGet model/provider config
POST/api/config/modelUpdate model/provider config

Tasks (Orchestration)

MethodPathDescription
POST/api/tasksCreate a task
GET/api/tasksList tasks (filterable by status, agent)
GET/api/tasks/{id}Get task details
POST/api/tasks/{id}/claimClaim task for an agent
POST/api/tasks/{id}/completeComplete with result data
DELETE/api/tasks/{id}Cancel a task
POST/api/tasks/swarmDecompose a goal into a DAG of subtasks
GET/api/tasks/statsTask statistics and queue depth

Tempo Wallet

MethodPathDescription
GET/api/walletAgent wallet overview (Solana + EVM balances)
GET/api/wallet/balancesLive RPC balance fetch
POST/api/wallet/tempo/callMetered HEDGEHOG API call (pay-per-inference)
GET/api/wallet/tempo/usageBilling history and totals
GET/api/wallet/tempo/pricingCurrent Tempo API pricing
POST/api/wallet/escrowLock funds for task reward
GET/api/wallet/escrowList escrow entries
POST/api/wallet/escrow/releaseRelease escrow (gaze-gated)
POST/api/wallet/escrow/{id}/refundRefund locked escrow

Gateway

MethodPathDescription
GET/healthHealth check + upstream status + capabilities
GET/api/gateway-statusFeature flags and connection mode
POST/api/chat/completions/streamOpenAI-compatible SSE proxy
*/v1/*Streaming proxy to Hermes Agent

Authentication

Three auth modes, checked in priority order:

CredentialResult
Valid API_KEY in Authorization: BearerAccess granted (subscriber)
Valid MPP payment credentialAccess granted (pay-per-request via Tempo)
No credential, nothing configuredOpen access

All routes except /health and /api/gateway-status are gated when auth is enabled.

Configuration

VariableDefaultDescription
HERMES_AGENT_URLhttp://localhost:8642Hermes Agent upstream URL
HERMES_HOME~/.hermesPath to Hermes config directory
OPTX_API_PORT8643API server port
MEMORY_BACKENDholographicMemory backend: holographic, spacetimedb, or sqlite
MEMORY_DB_URLSpacetimeDB connection URL
SPACETIMEDB_DBSpacetimeDB database name
API_KEYOptional API key for authentication
MPP_ENABLEDfalseEnable MPP pay-per-request gating

Installation

pip install -e .
hermes-optx-api --hermes-url http://localhost:8642

Or with Docker Compose (add to your Hermes stack):

services:
  hermes-optx-api:
    image: ghcr.io/jettoptx/hermes-optx-api:latest
    ports:
      - "8643:8643"
    environment:
      - HERMES_AGENT_URL=http://hermes-agent:8642
      - MEMORY_BACKEND=spacetimedb
      - MEMORY_DB_URL=http://your-spacetimedb-host:3000
      - SPACETIMEDB_DB=optx-cortex
    depends_on:
      - hermes-agent