This guide builds the proxy-router from source and walks through the API-only consumer flow (no MorpheusUI). For an Electron-included experience, see the packaged installs. For a four-terminal source walk-through (llama.cpp + proxy-router + UI + CLI), see macOS install.

Pre-requisites

  • An ERC-20 wallet on BASE with MOR + ETH (use a top-level, not derived, address). Never share your private key.

TL;DR

1

Install and configure proxy-router

Once.
2

Authorize the contract

Once per wallet (or whenever the allowance is depleted).
3

Query the blockchain for a model

Per session.
4

Open a session

Per session.
5

Send prompts

Per session.

A. Build & run the proxy-router

1

Install OS dependencies

2

Clone and enter the repo

git clone https://github.com/MorpheusAIs/Morpheus-Lumerin-Node.git
cd Morpheus-Lumerin-Node/proxy-router
3

Configure .env

cp .env.example .env
vi .env
Set at minimum:
  • WALLET_PRIVATE_KEY= — your wallet’s private key.
  • ETH_NODE_ADDRESS=wss://... — recommended: an Alchemy/Infura BASE WSS endpoint. Reference: Env: proxy-router.
4

Build and start

./build.sh
./proxy-router
On future updates: git pull && ./build.sh && ./proxy-router. Confirm Swagger at http://localhost:8082/swagger/index.html.

B. Authorize the contract

Either via Swagger or curl. Once per wallet, or when allowance is depleted.
curl -X POST \
  'http://localhost:8082/blockchain/approve?spender=0x6aBE1d282f72B474E54527D93b979A4f64d3030a&amount=3' \
  -H 'accept: application/json' -d ''

C. Query for a model

curl -X GET 'http://localhost:8082/wallet' -H 'accept: application/json'
curl -X GET 'http://localhost:8082/blockchain/models' -H 'accept: application/json'
Pick an Id from the response and use it as <modelId> below. See the API endpoints reference for the full schema.

D. Open a session

curl -s -X POST \
  'http://localhost:8082/blockchain/models/<modelId>/session' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"sessionDuration": 600}'
The transaction will appear in your wallet’s history at https://base.blockscout.com/address/<wallet_id>.

E. Prompt

curl -X POST 'http://localhost:8082/v1/chat/completions' \
  -H 'accept: application/json' \
  -H 'session_id: <sessionId>' \
  -H 'Content-Type: application/json' \
  -d '{
    "messages": [{"role":"user","content":"tell me a joke"}],
    "stream": true
  }'
The response is OpenAI-compatible SSE.

Quick-and-dirty one-liner

# Approve, query wallet, list models, open a session, prompt
curl -X POST 'http://localhost:8082/blockchain/approve?spender=0x6aBE1d282f72B474E54527D93b979A4f64d3030a&amount=3' -H 'accept: application/json' -d ''
curl -s 'http://localhost:8082/wallet' | jq .address
curl -s 'http://localhost:8082/blockchain/models' | jq -r '.models[] | "\(.Id), \(.Name)"'
SESSION=$(curl -s -X POST 'http://localhost:8082/blockchain/models/<modelId>/session' \
  -H 'Content-Type: application/json' -d '{"sessionDuration":600}' | jq -r .sessionId)
curl -X POST 'http://localhost:8082/v1/chat/completions' \
  -H "session_id: $SESSION" -H 'Content-Type: application/json' \
  -d '{"messages":[{"role":"user","content":"tell me a joke"}],"stream":true}'