Skip to main content
Claude Code speaks the Anthropic Messages API. Morph serves that format at /v1/messages for every open-source chat model, so Claude Code runs on Morph with four env vars. You need a Morph API key.

Run Claude Code on a Morph model

ANTHROPIC_MODEL remaps sonnet/opus. ANTHROPIC_SMALL_FAST_MODEL remaps haiku — the background calls for titles and summaries.
Or persist it in ~/.claude/settings.json:
Read, Edit, Write, Bash, and Grep run through the standard tool_use / tool_result loop. Streaming, system prompts, and cache_control work as Anthropic documents them; model reasoning arrives as thinking blocks. Model IDs are on the Open Source Models page — morph-glm53-744b and morph-glm53flash are cheaper alternatives to K3. Codex and per-task model routing: Claude Code & Codex.

Add Fast Apply and WarpGrep as tools

Independent of which model runs the loop, the morph CLI and its skills give Claude Code WarpGrep search and Fast Apply edits through its shell:
Prefer MCP? morph install --agent claude --mcp registers the legacy server; gate tools with ENABLED_TOOLS=codebase_search in its env. Then tell Claude when to reach for them:

Troubleshooting

401 on every request. Claude Code sends ANTHROPIC_AUTH_TOKEN as a bearer token; ANTHROPIC_API_KEY also works. Both go to the same Morph key — don’t leave an Anthropic key in either variable. Model not found. Use a Morph model ID (morph-kimik3), not claude-sonnet-4-6. Morph serves its own models, not Anthropic’s. Claude isn’t calling edit_file. Confirm the MCP server is connected with /mcp, and that the instructions above landed in ~/.claude/CLAUDE.md.