/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.
~/.claude/settings.json:
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-glm52-744b and morph-qwen35-397b 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 MCP server gives Claude Codeedit_file (10,500 tok/s merges) and codebase_search:
Troubleshooting
401 on every request. Claude Code sendsANTHROPIC_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.