Install and run the local proxy
After this page, you can run @spmos/local-proxy at http://127.0.0.1:8765 and route model requests through it.
Install the proxy
Install the current release, configure it, check the local configuration, and start the foreground process.
npm install --global @spmos/local-proxy@0.1.2
spm setup
spm doctor
spm start
You need Node.js >=22.15, an SPM key with the required scopes, an upstream provider key, and a client with a custom Base URL. spm and spm-local-proxy use the same CLI.
Setup asks for provider and SPM URLs and keys, API style, optional headers or query parameters, loopback host/port, memory and compression modes, and token budgets. Your client chooses the model.
Configure your client
Use 127.0.0.1:8765 in these examples, or replace it with your address. Hosted memory uses https://api.spmos.ai. Protect $SPM_CONFIG_HOME, $XDG_CONFIG_HOME/spm, or ~/.config/spm.
Generate the Codex configuration and local client token.
spm print-config codex
export SPM_LOCAL_PROXY_TOKEN="$(spm config token)"
Generate the Claude Code configuration.
spm print-config claude
Set the Claude Code endpoint and local token.
ANTHROPIC_BASE_URL="http://127.0.0.1:8765"
ANTHROPIC_API_KEY="$SPM_LOCAL_PROXY_TOKEN"
OpenAI-compatible SDKs use http://127.0.0.1:8765/v1. Anthropic Messages uses the anthropic_messages API style.
Keep data and limits in mind
The provider key, SPM key, and local token stay in local configuration. The provider key goes to the provider, the SPM key is used for memory calls, and the local token goes to your client.
Recall queries and eligible captured text go to SPM. Full provider requests go to the provider. Values containing $API_KEY are secrets.
Compression and tool-output elision can shorten history. Capture is best-effort, and memory is not a lossless archive. Keep originals when exact recovery matters. Verify important memories with status and read tools.
Use local endpoints
The local proxy exposes these endpoints:
POST /v1/chat/completions: OpenAI-compatible upstream.POST /v1/responses: OpenAI-compatible upstream.POST /v1/messages: Anthropic Messages upstream.GET /v1/models: upstream discovery for the configured OpenAI-compatible channel.GET /healthandGET /livez: local process checks.
Secure and troubleshoot the proxy
Keep the listener on loopback. Do not expose it as a shared gateway. Use the local token for your client, not your provider or SPM key. Use an HTTPS provider URL you trust. Protect local configuration, headers, and diagnostic output.
Local Proxy requests do not create hosted receipts, so they do not appear in dashboard Token savings or Recent request receipts. Use local response headers for evidence. Responses include x-spm-local-proxy (local proxy marker), memory/compression state, original/forwarded/recalled token estimates, and x-spm-continuity-state.
spm doctor checks local configuration, not key scopes or a live request. GET /v1/models fails when the provider lacks model discovery. Configure models in Settings → Providers; see Bring your own provider.
No reduction on a short or new conversation is expected. Multiple providers need separate config homes and ports. Stop the foreground process with Ctrl+C; this release has no daemon manager.
Verify
Check that the local health endpoint responds successfully.
curl -i http://127.0.0.1:8765/health
Expected: HTTP/1.1 200.