Apply
Apply code updates with Morph
Prerequisite: You’ll need an account on Morph to get an API key.
What is Fast Apply?
Fast Apply is Morph’s intelligent code model that helps you seamlessly integrate code changes into existing files. It understands both the original code and your intended updates, producing clean, consistent results.
Morph Apply API
Programmatically apply code updates with precision
Model | Speed | Accuracy |
---|---|---|
morph-v3-fast | 4500+ tok/sec | 96% |
morph-v3-large | 2500+ tok/sec | 98% |
auto | 2500-4500 tok/sec | ~98% |
Why Use Morph Fast Apply?
The best coding agents use Fast Apply models to integrate code changes into existing files.
This lets frontier models like GPT-4o, Claude, and Gemini focus on the hard reasoning tasks, while a dumber model like Morph Fast Apply handles the integration.
- Patch/Diff edits are currently unreliable and often break existing code
- Fast and Cheaper: Morph Fast Apply is fast
You should use Morph Fast Apply in an edit_file tool call. See the edit_file tool call for more details.
Example Usage
MCP Server Usage
For applications using the MCP (Model Context Protocol) server, you can authenticate once and use the tools without providing the API key on each request:
The MCP server stores your API key in memory for the session, so you only need to provide it once during the initial connection. The session ID is returned in the response headers and can be used for subsequent requests.