Skip to main content

Try GLM-5.2 on 5% of your traffic

A canary rollout: keep your current provider, send a slice of production traffic to GLM-5.2, and compare Reflex results before switching over. Paste this into your coding agent:

Full tracing + Reflexes guide

How begin() / finish() and evals fit together, plus reading labels back by model.

24 hours later: ask Claude Code what happened

Your canary now has a day of labeled production traffic. Install the Morph MCP so Claude Code can read it:
Terminal
Then paste this:
Prompt: compare the canary against your old model
The one-liner adds list_reflexes, reflex_summary, and get_reflex_traces (plus codebase_search and edit_file) to Claude Code, Cursor, and Codex. MCP setup guide →

Open Source Models + Reflexes

Open-weight models — GLM-5.2, MiniMax, DeepSeek V4 — on the same OpenAI-compatible API. Call one with the OpenAI package, then label every turn with a Reflex.
1

Call a model

Point the OpenAI SDK at Morph and pick a model.
Every model and its context window is on the Open Source Models page.
2

Label every turn with Reflexes

One morphTracing call instruments the OpenAI SDK. Wrap the turn, name the Reflexes that label it, and Morph classifies each one async — off your request path, no added latency.
See the labels two ways: open the Traces dashboard, or pull them in code with morph.traces.list() — each turn carries its labels under reflexResults. Tracing is async, so labels land shortly after the turn does.Want a label inline instead of async? Call morph.reflex.predict() and read the result on the spot:

Fast Apply

Your agent outputs a lazy edit snippet (changed lines + // ... existing code ... markers). Morph merges it into the original file and returns the result. 98% accuracy, sub-second latency.
1

Install

Get your API key from the dashboard.
2

Run it

Save as apply.ts and run:
The instructions parameter must be generated by the model, not hardcoded. It provides context for ambiguous edits. Example: “Adding error handling to the user auth and removing the old auth functions.”
3

Add to your agent

The SDK provides tool factories for every major framework. One line gives your agent an edit_file tool:
For tool definition schemas, system prompt instructions, and output-parsing mode, see the Fast Apply product page.

WarpGrep

Code search subagent. Searches your codebase in its own context window, finds relevant code in 3.8 steps, returns file/line-range spans. Your agent’s context stays clean.
1

Install

Same @morphllm/morphsdk from above — WarpGrep just needs ripgrep on your PATH.
2

Run it

3

Add to your agent

Same factory pattern as Fast Apply — createWarpGrepTool for any framework:
morph.openai.createWarpGrepTool() and morph.vercel.createWarpGrepTool() mirror this. For streaming, GitHub search, sandbox execution, and the raw API protocol, see the WarpGrep product page.

Next Steps

Open Source Models

Qwen, GLM, MiniMax, DeepSeek — context windows and pricing

Reflexes

Label every turn — jailbreaks, loops, frustration, and more

Fast Apply

Tool schemas, system prompts, and the lazy edit format

WarpGrep

Streaming, GitHub search, remote execution

MCP Integration

One command to add Morph to Claude Code, Cursor, or Codex

SDK Reference

Complete API documentation