MemoDocumentation
EN

Developer API Gateway: Using Memo From Claude Code

Sidebar → Developer turns Memo into a local, Anthropic-compatible endpoint. Point Claude Code (or anything else that only speaks Anthropic's Messages API) at it, and Memo runs whatever's actually behind that request — your local model, or any external provider you've already configured — while Claude Code keeps working exactly the way it always does.

Step 1 — Get your Base URL

Open Memo's sidebar → Developer. The top of the screen shows a copyable Base URL — by default this is http://localhost:8090, matching the port Memo's backend listens on. If you changed the backend's port, this reflects that.

Step 2 — Point Claude Code at it

Claude Code reads its target server from environment variables. Set these before launching claude:

# bash / zsh
export ANTHROPIC_BASE_URL="http://localhost:8090"
export ANTHROPIC_API_KEY="not-needed"
export ANTHROPIC_MODEL="local/qwen2.5"
# fish
set -x ANTHROPIC_BASE_URL "http://localhost:8090"
set -x ANTHROPIC_API_KEY "not-needed"
set -x ANTHROPIC_MODEL "local/qwen2.5"

ANTHROPIC_API_KEY can be any non-empty string when the Developer screen's Require API Key toggle is off (the default) — Memo doesn't check it, but Claude Code's own SDK refuses to start without something set. If you turn Require API Key on, use the real token shown on the Developer screen instead (the same token Remote Access uses) — Claude Code sends it automatically as x-api-key.

Step 3 — Pick a model with type/model-id

Memo's gateway reads the request's model field as <type>/<model-id>:

Value What it routes to
local/qwen2.5 Whatever local llama.cpp model is currently loaded in Memo — the qwen2.5 part is just a label, the real model is whatever's actually running
openai/gpt-4o Your enabled OpenAI provider under Settings → API Providers, with model gpt-4o
custom/<model-id> Your enabled custom provider (an OpenAI-compatible endpoint you've configured yourself — LM Studio, vLLM, etc.)

The Developer screen lists every currently valid type/model-id combination as copyable entries — it changes based on which local model you have loaded and which providers you have enabled. Set one as ANTHROPIC_MODEL before launching, or switch mid-session with Claude Code's own /model command, e.g. /model openai/gpt-4o.

Step 4 — Just use Claude Code

Run claude as you normally would. Nothing about its interface changes — reading and writing files, running shell commands, and multi-turn tool-use conversations all work exactly like they do against the real Anthropic API, because the gateway does a full, bidirectional translation of Anthropic's wire format (including the specific detail of a tool call's arguments being a JSON object on Anthropic's side vs. a JSON-encoded string on OpenAI's side).

One real limitation: tool calling doesn't yet work if the resolved model belongs to the gemini, claude, or ollama provider types — their underlying implementations in Memo don't support tool definitions at all yet. A tools-bearing request routed to one of those returns a clear error rather than silently dropping the tools, so you'll know immediately rather than getting confusing partial behavior.

Checking it's actually working

The bottom of the Developer screen shows a live log of every request passing through the gateway, refreshing every couple of seconds while the screen is open — time, resolved model, whether it used streaming/tools, duration, and a preview of the request/response. This is the fastest way to confirm your first Claude Code request actually landed, and to see exactly which model it resolved to.

Memory and chat history stay separate

Two settings on this screen default to off: Require API Key (see above) and Use Memory. Turning memory integration on enriches gateway requests with relevant facts from Memo's own RAG memory before they're sent to the model — but a coding session run through Claude Code this way never creates a visible chat in Memo's own history, even with memory on. Gateway traffic and your regular chats are kept deliberately separate.