{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry in 12 seconds."
}
}
{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side."
}
}
🔒 CONFIDENTIAL - INTERNAL USE ONLYThis page contains proprietary enterprise API documentation and is linked to your account. Do not share any information mentioned here with anyone external to your company. This documentation is for internal development and integration purposes only.
Quickstart
Switch to instruction-guided editing with 98% accuracy in 3 steps.
Prerequisites
Enterprise API key from your Morph account
Access to https://api.morphllm.com/v1/
Model
Speed
Accuracy
Input Limit
Output Limit
morph-v3-fast
10,500+ tok/sec
96%
16k tokens
16k tokens
morph-v3-large
5000+ tok/sec
98%
16k tokens
16k tokens
auto
5000-10,500tok/sec
98%
16k tokens
16k tokens
1. Configure Your Edit Tool
Set up your AI agent to generate the proper instructions guided format for the highest accuracy editing.
XML Tool
JSON Tool (Simple)
Edit File Tool Description:
Use this tool to make an edit to an existing file.This will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.When writing the edit, you should specify each edit in sequence, with the special comment // ... existing code ... to represent unchanged code in between edited lines.For example:// ... existing code ...FIRST_EDIT// ... existing code ...SECOND_EDIT// ... existing code ...THIRD_EDIT// ... existing code ...You should still bias towards repeating as few lines of the original file as possible to convey the change.But, each edit should contain minimally sufficient context of unchanged lines around the code you're editing to resolve ambiguity.DO NOT omit spans of pre-existing code (or comments) without using the // ... existing code ... comment to indicate its absence. If you omit the existing code comment, the model may inadvertently delete these lines.If you plan on deleting a section, you must provide context before and after to delete it. If the initial code is ```code \n Block 1 \n Block 2 \n Block 3 \n code```, and you want to remove Block 2, you would output ```// ... existing code ... \n Block 1 \n Block 3 \n // ... existing code ...```.Make sure it is clear what the edit should be, and where it should be applied.ALWAYS make all edits to a file in a single edit_file instead of multiple edit_file calls to the same file. The apply model can handle many distinct edits at once.
Parameters:
target_filepath (string, required): The path of the target file to modify
instructions (string, required): A single sentence written in the first person describing what you’re changing. Used to help disambiguate uncertainty in the edit.
code_edit (string, required): Specify ONLY the precise lines of code that you wish to edit. Use // ... existing code ... for unchanged sections.
Tool Definition:
{ "name": "edit_file", "description": "Use this tool to make an edit to an existing file.\n\nThis will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.\nWhen writing the edit, you should specify each edit in sequence, with the special comment // ... existing code ... to represent unchanged code in between edited lines.\n\nFor example:\n\n// ... existing code ...\nFIRST_EDIT\n// ... existing code ...\nSECOND_EDIT\n// ... existing code ...\nTHIRD_EDIT\n// ... existing code ...\n\nYou should still bias towards repeating as few lines of the original file as possible to convey the change.\nBut, each edit should contain minimally sufficient context of unchanged lines around the code you're editing to resolve ambiguity.\nDO NOT omit spans of pre-existing code (or comments) without using the // ... existing code ... comment to indicate its absence. If you omit the existing code comment, the model may inadvertently delete these lines.\nIf you plan on deleting a section, you must provide context before and after to delete it. If the initial code is ```code \\n Block 1 \\n Block 2 \\n Block 3 \\n code```, and you want to remove Block 2, you would output ```// ... existing code ... \\n Block 1 \\n Block 3 \\n // ... existing code ...```.\nMake sure it is clear what the edit should be, and where it should be applied.\nALWAYS make all edits to a file in a single edit_file instead of multiple edit_file calls to the same file. The apply model can handle many distinct edits at once.", "parameters": { "properties": { "target_filepath": { "type": "string", "description": "Path of the target file to modify." }, "instructions": { "type": "string", "description": "A single sentence instruction describing what you are going to do for the sketched edit. This is used to assist the less intelligent model in applying the edit. Use the first person to describe what you are going to do. Use it to disambiguate uncertainty in the edit." }, "code_edit": { "type": "string", "description": "Specify ONLY the precise lines of code that you wish to edit. NEVER specify or write out unchanged code. Instead, represent all unchanged code using the comment of the language you're editing in - example: // ... existing code ..." } }, "required": ["target_filepath", "instructions", "code_edit"] }}
The instructions field should be generated by your AI model, not user input.
Follow the tool description above nearly verbatim - terminology like “use it to disambiguate uncertainty in the edit” should be used.
Example: “I am adding error handling to the user authentication function”
2. Send to Morph Enterprise API
import { OpenAI } from 'openai';const client = new OpenAI({ apiKey: 'your-enterprise-api-key', baseURL: 'https://api.morphllm.com/v1'});const testOriginalCode = `const a = 1const b = 2function add(a, b) { return a + b}function subtract(a, b) { return a - b}const authenticateUser () => { return "Authenticated"}`;// Test data - your agent should generate theseconst testInstruction = "I will add the real user authentication function and remove the old authentication method";const testUpdateSnippet = ` // ... existing code ...const authenticateUser = (email, password) => { const result = await verifyUser(email, password) if (result) { return "Authenticated" } else { return "Unauthenticated" }}`;async function applyEnterpriseEdit( instruction: string, originalCode: string, updateSnippet: string): Promise<string> { const response = await client.chat.completions.create({ model: "morph-v3-fast", messages: [ { role: "user", content: `<instruction>${instruction}</instruction>\n<code>${originalCode}</code>\n<update>${updateSnippet}</update>` } ] }); return response.choices[0].message.content || '';}// Example usageasync function main() { try { const finalCode = await applyEnterpriseEdit( testInstruction, testOriginalCode, testUpdateSnippet ); console.log("Final merged code:"); console.log(finalCode); } catch (error) { console.error("Error applying edit:", error); }}// Run the examplemain();
import openaiimport asyncioclient = openai.OpenAI( api_key="your-enterprise-api-key", base_url="https://api.morphllm.com/v1")test_original_code = """const a = 1const b = 2def add(a, b): return a + b}def subtract(a, b): return a - b}def authenticateUser (): return "Authenticated"}"""# Test data - your agent should generate thesetest_instruction = "I will add the real user authentication function and remove the old authentication method" # This is the instruction that your agent should generatetest_update_snippet = """def authenticateUser (email, password) => { # ... existing code ... result = await verifyUser(email, password) if (result) { return "Authenticated" } else { return "Unauthenticated" }}"""def apply_enterprise_edit(instruction: str, original_code: str, update_snippet: str): """Apply an enterprise edit using Morph's instruction-guided editing.""" response = client.chat.completions.create( model="morph-v3-fast", messages=[ { "role": "user", "content": f"<instruction>{instruction}</instruction>\n<code>{original_code}</code>\n<update>{update_snippet}</update>" } ] ) return response.choices[0].message.content# Example usageif __name__ == "__main__": final_code = apply_enterprise_edit( test_instruction, test_original_code, test_update_snippet ) print("Final merged code:") print(final_code)
3. Handle the Response
Extract the merged code from the enterprise API response.Response Format:
final_code = response.choices[0].message.content
Extract the Final Code:
const finalCode = response.choices[0].message.content;// Write to file or return to your applicationawait fs.writeFile(targetFile, finalCode);
final_code = response.choices[0].message.content# Write to file or return to your application with open(target_file, 'w') as f: f.write(final_code)
Enterprise Features
Perfect Accuracy
Instruction-guided editing achieves 98% accuracy on complex code changes
44k Input Tokens
Handle entire large files, complete modules, and complex codebases
36k Output Tokens
Generate complete implementations, full refactors, and comprehensive updates
Migration from Standard API:
Enterprise API requires an <instruction> field but maintains backward compatibility with existing <update> patterns.
Chat completion request for Apply or Warp Grep (OpenAI-compatible)
Morph Apply
Warp Grep
Either a Morph Apply request or a Warp Grep request, discriminated by model.
model
enum<string>
default:morph-v3-fast
required
ID of the Apply model to use, or auto to let the router choose
Available options:
morph-v3-fast,
morph-v3-large,
auto
Example:
"morph-v3-fast"
messages
object[]
required
Array containing a single user message with structured content using instruction-guided format
Show child attributes
Example:
[ { "role": "user", "content": "<instruction>I will add error handling</instruction>\n<code>function divide(a, b) {\n return a / b;\n}</code>\n<update>function divide(a, b) {\n if (b === 0) throw new Error('Division by zero');\n return a / b;\n}</update>" } ]
stream
boolean
default:false
Enable streaming response. When true the response is a text/event-stream of OpenAI-style chat.completion.chunk deltas terminated by data: [DONE].
Example:
false
max_tokens
integer
Maximum number of tokens the Apply model may generate
Example:
150
temperature
number
default:0
Sampling temperature for the Apply request (0.0 for deterministic output)
Example:
0
Response
Chat completion response
Completion returned by a Morph chat model.
id
string
required
Unique identifier for the completion
Example:
"chatcmpl-123"
object
string
required
Always chat.completion
Example:
"chat.completion"
created
integer
required
Unix timestamp of when the completion was created
Example:
1677652288
choices
object[]
required
List of completion choices
Show child attributes
Example:
[ { "index": 0, "message": { "role": "assistant", "content": "\ndef calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\n" }, "finish_reason": "stop" } ]
{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry in 12 seconds."
}
}
{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side."
}
}
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"Morph Documentation","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/morph-555d6c14/lwaqk6ujzMJV1czI/logo/light.svg?fit=max\u0026auto=format\u0026n=lwaqk6ujzMJV1czI\u0026q=85\u0026s=cd5a33b1dd765106a68d6f487a1e20f1","dark":"https://mintcdn.com/morph-555d6c14/lwaqk6ujzMJV1czI/logo/dark.svg?fit=max\u0026auto=format\u0026n=lwaqk6ujzMJV1czI\u0026q=85\u0026s=c1c314250fc34da822ffa325af1cc60e","href":"https://morphllm.com"},"favicon":"https://mintcdn.com/morph-555d6c14/81UoWpotGPzGjPQ0/favicon.ico?fit=max\u0026auto=format\u0026n=81UoWpotGPzGjPQ0\u0026q=85\u0026s=0f94266a609b76a75975d1377f33b7e0","api":{"playground":{}},"navbar":{"links":[{"href":"https://discord.gg/AdXta4yxEK","label":"Community"},{"href":"https://morphllm.com/blog","label":"Blog"}],"primary":{"type":"button","label":"Dashboard","href":"https://morphllm.com/dashboard"}},"seo":{"indexing":"all"},"styling":{"latex":true},"contextual":{"options":["copy","view","download-spec","chatgpt","claude"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"morph-555d6c14","hasAudioNarration":false,"actualSubdomain":"morph-555d6c14","customDomains":["docs.morphllm.com"],"gitSource":{"type":"github","owner":"morphllm","repo":"landing","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b05dd260c6a5ff80e42d1ee","clientVersion":"0.0.4336","searchFilterCounts":[{"language":"default","tag":"API Reference","count":20},{"language":"default","tag":"Models","count":18},{"language":"default","tag":"Integrations","count":12},{"language":"default","tag":"Get Started","count":10},{"language":"default","tag":"Guides","count":7},{"language":"default","tag":"WarpGrep","count":7},{"language":"default","tag":"Frameworks","count":4},{"language":"default","tag":"Open Source Models","count":4},{"language":"default","tag":"Account","count":3},{"language":"default","tag":"Dedicated","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false,"authValue":{"userAuth":{"type":"shared-session","apiUrl":"https://www.morphllm.com/api/user/session","loginUrl":"https://www.morphllm.com/dashboard","invalidatedAt":1765493560614}}},"customCss":[]}
{"page":{"pagePath":"api-reference/endpoint/enterprise","slug":"/api-reference/endpoint/enterprise","pageMetadata":{"title":"Enterprise Apply","description":"Enterprise Apply API with custom model configurations","openapi":"POST /v1/chat/completions","href":"/api-reference/endpoint/enterprise"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Enterprise Apply API with custom model configurations\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,CodeGroup,Heading,Note,Tab,Table,Tabs,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`🔒 CONFIDENTIAL - INTERNAL USE ONLY`})}),_jsx(_components.p,{children:`This page contains proprietary enterprise API documentation and is linked to your account. Do not share any information mentioned here with anyone external to your company. This documentation is for internal development and integration purposes only.`})]}),`\n`,_jsx(Heading,{level:`1`,id:`quickstart`,children:`Quickstart`}),`\n`,_jsx(_components.p,{children:`Switch to instruction-guided editing with 98% accuracy in 3 steps.`}),`\n`,_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Enterprise API key from your Morph account`}),`\n`,_jsxs(_components.li,{children:[`Access to `,_jsx(_components.code,{children:`https://api.morphllm.com/v1/`})]}),`\n`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Model`}),_jsx(_components.th,{children:`Speed`}),_jsx(_components.th,{children:`Accuracy`}),_jsx(_components.th,{children:`Input Limit`}),_jsx(_components.th,{children:`Output Limit`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`morph-v3-fast`}),_jsx(_components.td,{children:`10,500+ tok/sec`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.strong,{children:`96%`})}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`16k tokens`})}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`16k tokens`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`morph-v3-large`}),_jsx(_components.td,{children:`5000+ tok/sec`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.strong,{children:`98%`})}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`16k tokens`})}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`16k tokens`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`auto`}),_jsx(_components.td,{children:`5000-10,500tok/sec`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.strong,{children:`98%`})}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`16k tokens`})}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`16k tokens`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`1-configure-your-edit-tool`,children:`1. Configure Your Edit Tool`}),`\n`,_jsx(_components.p,{children:`Set up your AI agent to generate the proper instructions guided format for the highest accuracy editing.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`XML Tool`,id:`xml-tool`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Edit File Tool Description:`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`xml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`xml`,children:_jsxs(_components.code,{language:`xml`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`Use this tool to make an edit to an existing file.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`This will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`When writing the edit, you should specify each edit in sequence, with the special comment // ... existing code ... to represent unchanged code in between edited lines.`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`For example:`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`// ... existing code ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`FIRST_EDIT`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`// ... existing code ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SECOND_EDIT`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`// ... existing code ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`THIRD_EDIT`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`// ... existing code ...`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`You should still bias towards repeating as few lines of the original file as possible to convey the change.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`But, each edit should contain minimally sufficient context of unchanged lines around the code you're editing to resolve ambiguity.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`DO NOT omit spans of pre-existing code (or comments) without using the // ... existing code ... comment to indicate its absence. If you omit the existing code comment, the model may inadvertently delete these lines.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"If you plan on deleting a section, you must provide context before and after to delete it. If the initial code is ```code \\\\n Block 1 \\\\n Block 2 \\\\n Block 3 \\\\n code```, and you want to remove Block 2, you would output ```// ... existing code ... \\\\n Block 1 \\\\n Block 3 \\\\n // ... existing code ...```.\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`Make sure it is clear what the edit should be, and where it should be applied.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ALWAYS make all edits to a file in a single edit_file instead of multiple edit_file calls to the same file. The apply model can handle many distinct edits at once.`})}),`\n`]})})}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Parameters:`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`target_filepath`}),` (string, required): The path of the target file to modify`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`instructions`}),` (string, required): A single sentence written in the first person describing what you’re changing. Used to help disambiguate uncertainty in the edit.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`code_edit`}),` (string, required): Specify ONLY the precise lines of code that you wish to edit. Use `,_jsx(_components.code,{children:`// ... existing code ...`}),` for unchanged sections.`]}),`\n`]})]}),_jsxs(Tab,{title:`JSON Tool (Simple)`,id:`json-tool-simple`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Tool Definition:`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"edit_file\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{children:` \"description\": \"Use this tool to make an edit to an existing file.\\\\n\\\\nThis will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.\\\\nWhen writing the edit, you should specify each edit in sequence, with the special comment`}),_jsx(_components.span,{children:` // ... existing code ... to represent unchanged code in between edited lines.\\\\n\\\\nFor example:\\\\n\\\\n// ... existing code ...\\\\nFIRST_EDIT\\\\n// ... existing code ...\\\\nSECOND_EDIT\\\\n// ... existing code ...\\\\nTHIRD_EDIT\\\\n// ... existing code ...\\\\n\\\\nYou should still bias towards repeating as few lines of the original file as possible to convey the change.\\\\nBut, each edit should contain minimally sufficient context of unchanged lines around the code you're editing to resolve ambiguity.\\\\nDO NOT omit spans of pre-existing code (or comments) without using the`}),_jsx(_components.span,{children:\" // ... existing code ... comment to indicate its absence. If you omit the existing code comment, the model may inadvertently delete these lines.\\\\nIf you plan on deleting a section, you must provide context before and after to delete it. If the initial code is ```code \\\\\\\\n Block 1 \\\\\\\\n Block 2 \\\\\\\\n Block 3 \\\\\\\\n code```, and you want to remove Block 2, you would output ```// ... existing code ... \\\\\\\\n Block 1 \\\\\\\\n Block 3 \\\\\\\\n\"}),_jsx(_components.span,{children:' // ... existing code ...```.\\\\nMake sure it is clear what the edit should be, and where it should be applied.\\\\nALWAYS make all edits to a file in a single edit_file instead of multiple edit_file calls to the same file. The apply model can handle many distinct edits at once.\",'})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"parameters\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"properties\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"target_filepath\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Path of the target file to modify.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"instructions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"A single sentence instruction describing what you are going to do for the sketched edit. This is used to assist the less intelligent model in applying the edit. Use the first person to describe what you are going to do. Use it to disambiguate uncertainty in the edit.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code_edit\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Specify ONLY the precise lines of code that you wish to edit. NEVER specify or write out unchanged code. Instead, represent all unchanged code using the comment of the language you're editing in - example:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` // ... existing code ...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"required\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"target_filepath\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"instructions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"code_edit\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`instructions`}),` field should be generated by your AI model, not user input.\nFollow the tool description above nearly verbatim - terminology like “use it to disambiguate uncertainty in the edit” should be used.\nExample: “I am adding error handling to the user authentication function”`]})}),`\n`,_jsx(Heading,{level:`2`,id:`2-send-to-morph-enterprise-api`,children:`2. Send to Morph Enterprise API`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`enterprise_apply.ts`,numberOfLines:`73`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`73`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'openai'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'your-enterprise-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.morphllm.com/v1'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` testOriginalCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `\"})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`const a = 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`const b = 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`function add(a, b) {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return a + b`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`function subtract(a, b) {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return a - b`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`const authenticateUser () => {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return \"Authenticated\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Test data - your agent should generate these`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` testInstruction`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"I will add the real user authentication function and remove the old authentication method\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` testUpdateSnippet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `\"})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` // ... existing code ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`const authenticateUser = (email, password) => {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` const result = await verifyUser(email, password)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` if (result) {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return \"Authenticated\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` } else {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return \"Unauthenticated\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` applyEnterpriseEdit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` instruction`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` originalCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` updateSnippet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` string`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Promise`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"morph-v3-fast\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `\u003cinstruction>\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`instruction`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003c/instruction>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003ccode>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`originalCode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003c/code>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003cupdate>`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`updateSnippet`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"\u003c/update>`\"})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ''`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Example usage`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` finalCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` applyEnterpriseEdit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` testInstruction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` testOriginalCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` testUpdateSnippet`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Final merged code:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`finalCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Error applying edit:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Run the example`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`enterprise_apply.py`,numberOfLines:`62`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`62`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` asyncio`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai.OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your-enterprise-api-key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.morphllm.com/v1\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`test_original_code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`const a = 1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`const b = 2`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`def add(a, b):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return a + b`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`def subtract(a, b):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return a - b`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`def authenticateUser ():`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return \"Authenticated\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Test data - your agent should generate these`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`test_instruction `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"I will add the real user authentication function and remove the old authentication method\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # This is the instruction that your agent should generate`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`test_update_snippet `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`def authenticateUser (email, password) => {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` # ... existing code ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` result = await verifyUser(email, password)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` if (result) {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return \"Authenticated\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` } else {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return \"Unauthenticated\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` apply_enterprise_edit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`instruction`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`original_code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`update_snippet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"\"Apply an enterprise edit using Morph's instruction-guided editing.\"\"\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.chat.completions.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"morph-v3-fast\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cinstruction>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`instruction`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003c/instruction>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003ccode>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`original_code`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003c/code>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003cupdate>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`update_snippet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u003c/update>\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Example usage`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:` __name__`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"__main__\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` final_code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` apply_enterprise_edit(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` test_instruction, `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` test_original_code, `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` test_update_snippet`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Final merged code:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(final_code)`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`3-handle-the-response`,children:`3. Handle the Response`}),`\n`,_jsx(_components.p,{children:`Extract the merged code from the enterprise API response.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Response Format:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`final_code = response.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Extract the Final Code:`})}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`extract_code.ts`,numberOfLines:`3`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` finalCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Write to file or return to your application`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`writeFile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`targetFile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`finalCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`extract_code.py`,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`final_code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Write to file or return to your application `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(target_file, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'w'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f.write(final_code)`})}),`\n`]})})})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`enterprise-features`,children:`Enterprise Features`}),`\n`,_jsxs(CardGroup,{cols:3,children:[_jsx(Card,{title:`Perfect Accuracy`,icon:`target`,children:_jsx(_components.p,{children:`Instruction-guided editing achieves 98% accuracy on complex code changes`})}),_jsx(Card,{title:`44k Input Tokens`,icon:`file-text`,children:_jsx(_components.p,{children:`Handle entire large files, complete modules, and complex codebases`})}),_jsx(Card,{title:`36k Output Tokens`,icon:`code`,children:_jsx(_components.p,{children:`Generate complete implementations, full refactors, and comprehensive updates`})})]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Migration from Standard API:`})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Enterprise API requires an `,_jsx(_components.code,{children:`\u003cinstruction>`}),` field but maintains backward compatibility with existing `,_jsx(_components.code,{children:`\u003cupdate>`}),` patterns.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Enterprise Apply","description":"Enterprise Apply API with custom model configurations","openapi":"POST /v1/chat/completions","href":"/api-reference/endpoint/enterprise"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Quickstart","slug":"quickstart","depth":1,"children":[]},{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"1. Configure Your Edit Tool","slug":"1-configure-your-edit-tool","depth":2,"children":[]},{"title":"2. Send to Morph Enterprise API","slug":"2-send-to-morph-enterprise-api","depth":2,"children":[]},{"title":"3. Handle the Response","slug":"3-handle-the-response","depth":2,"children":[]},{"title":"Enterprise Features","slug":"enterprise-features","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createChatCompletion","summary":"Create a chat completion","description":"Enterprise Apply API with custom model configurations","tags":["chat"],"security":["ebf75de3-7e2b-4ee9-af3c-8d6c09c1658d"],"requestBody":"c0219d2e-e128-4026-a34e-2d228c4baea8","responses":{"200":"1e39476f-d337-4943-8e62-4734c0b45385","400":"d5c5d624-62f4-4210-82d6-d1aec1c7589a","401":"66223226-ca0b-45d0-b76b-a95da68fd7c8","429":"0d3953fd-2a15-4def-848a-2f0dcb7cf6cb","500":"b6eb94a3-1903-4d84-bf87-2f5be3f16ebe"},"method":"post","type":"path","servers":["05b02330-989f-400f-923d-bb9048118f5a"],"path":"/v1/chat/completions","baseUrlOptions":["https://api.morphllm.com"],"title":"Create a chat completion","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"description":"Chat completion request for Apply or Warp Grep (OpenAI-compatible)","required":true,"content":{"application/json":{"example":{"model":"morph-v3-fast","messages":[{"role":"user","content":"\u003cinstruction>I will add error handling\u003c/instruction>\n\u003ccode>function divide(a, b) {\n return a / b;\n}\u003c/code>\n\u003cupdate>function divide(a, b) {\n if (b === 0) throw new Error('Division by zero');\n return a / b;\n}\u003c/update>"}],"stream":false,"max_tokens":150,"temperature":0},"schema":{"oneOf":[{"type":"object","title":"Morph Apply","description":"Either a Morph Apply request or a Warp Grep request, discriminated by `model`.","required":["model","messages"],"example":{"model":"morph-v3-fast","messages":[{"role":"user","content":"\u003cinstruction>I will add error handling\u003c/instruction>\n\u003ccode>function divide(a, b) {\n return a / b;\n}\u003c/code>\n\u003cupdate>function divide(a, b) {\n if (b === 0) throw new Error('Division by zero');\n return a / b;\n}\u003c/update>"}],"stream":false,"max_tokens":150,"temperature":0},"properties":{"model":{"type":"string","enum":["morph-v3-fast","morph-v3-large","auto"],"default":"morph-v3-fast","description":"ID of the Apply model to use, or `auto` to let the router choose","example":"morph-v3-fast","isRequired":true,"uniqueKey":"oneOf.0.model","typeLabel":"enum\u003cstring>"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"],"description":"Which participant produced this chat message","example":"user","isRequired":true,"uniqueKey":"oneOf.0.messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","description":"The content of the message, containing code and update snippets. An Apply message uses the format: \u003cinstruction>First-person description\u003c/instruction>\u003ccode>Complete original file content\u003c/code>\u003cupdate>Code snippet with // ... existing code ... markers\u003c/update>","example":"\u003cinstruction>I will add logic to add 10% tax\u003c/instruction>\n\u003ccode>def calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total\u003c/code>\n\u003cupdate>def calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\u003c/update>","isRequired":true,"uniqueKey":"oneOf.0.messages.items.[INDEX].content","typeLabel":"string"}},"required":["role","content"],"description":"A single chat message.","example":{"role":"user","content":"\u003cinstruction>I will add logic to add 10% tax\u003c/instruction>\n\u003ccode>def calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total\u003c/code>\n\u003cupdate>def calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\u003c/update>"},"uniqueKey":"oneOf.0.messages.items.[INDEX]","typeLabel":"object"},"default":[{"role":"user","content":"\u003cinstruction>I will add error handling\u003c/instruction>\n\u003ccode>function divide(a, b) {\n return a / b;\n}\u003c/code>\n\u003cupdate>function divide(a, b) {\n if (b === 0) throw new Error('Division by zero');\n return a / b;\n}\u003c/update>"}],"description":"Array containing a single user message with structured content using instruction-guided format","example":[{"role":"user","content":"\u003cinstruction>I will add error handling\u003c/instruction>\n\u003ccode>function divide(a, b) {\n return a / b;\n}\u003c/code>\n\u003cupdate>function divide(a, b) {\n if (b === 0) throw new Error('Division by zero');\n return a / b;\n}\u003c/update>"}],"isRequired":true,"uniqueKey":"oneOf.0.messages","typeLabel":"object[]"},"stream":{"type":"boolean","default":false,"description":"Enable streaming response. When true the response is a `text/event-stream` of OpenAI-style `chat.completion.chunk` deltas terminated by `data: [DONE]`.","example":false,"uniqueKey":"oneOf.0.stream","typeLabel":"boolean"},"max_tokens":{"type":"integer","description":"Maximum number of tokens the Apply model may generate","example":150,"uniqueKey":"oneOf.0.max_tokens","typeLabel":"integer"},"temperature":{"type":"number","default":0,"description":"Sampling temperature for the Apply request (0.0 for deterministic output)","example":0,"uniqueKey":"oneOf.0.temperature","typeLabel":"number"}},"uniqueKey":"oneOf.0","typeLabel":"Morph Apply · object"},{"type":"object","title":"Warp Grep","description":"Either a Morph Apply request or a Warp Grep request, discriminated by `model`.","required":["model","messages"],"example":{"model":"morph-v3-fast","messages":[{"role":"user","content":"\u003cinstruction>I will add error handling\u003c/instruction>\n\u003ccode>function divide(a, b) {\n return a / b;\n}\u003c/code>\n\u003cupdate>function divide(a, b) {\n if (b === 0) throw new Error('Division by zero');\n return a / b;\n}\u003c/update>"}],"temperature":0,"max_tokens":150},"properties":{"model":{"type":"string","enum":["morph-warp-grep-v1"],"default":"morph-warp-grep-v1","description":"ID of the Warp Grep model","example":"morph-warp-grep-v1","isRequired":true,"uniqueKey":"oneOf.1.model","typeLabel":"enum\u003cstring>"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"],"description":"Which participant produced this Warp Grep turn","example":"user","isRequired":true,"uniqueKey":"oneOf.1.messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"type":"string","description":"Message content. User messages use \u003crepo_structure> and \u003csearch_string> XML. Assistant messages contain \u003cthink> reasoning and XML tool calls (\u003cgrep>, \u003cread>, \u003clist_directory>, \u003cfinish>).","example":"\u003crepo_structure>\nmyapp/\n src/\n auth/\n\u003c/repo_structure>\n\n\u003csearch_string>\nFind where JWT tokens are validated\n\u003c/search_string>","isRequired":true,"uniqueKey":"oneOf.1.messages.items.[INDEX].content","typeLabel":"string"}},"required":["role","content"],"description":"A single turn in a Warp Grep search conversation.","example":{"role":"user","content":"\u003crepo_structure>\nmyapp/\n src/\n auth/\n\u003c/repo_structure>\n\n\u003csearch_string>\nFind where JWT tokens are validated\n\u003c/search_string>"},"uniqueKey":"oneOf.1.messages.items.[INDEX]","typeLabel":"object"},"description":"Multi-turn conversation with system prompt, user queries, assistant tool calls, and tool results","example":[{"role":"system","content":"You are a code search agent..."},{"role":"user","content":"\u003crepo_structure>\nmyapp/\n src/\n auth/\n\u003c/repo_structure>\n\n\u003csearch_string>\nFind JWT validation\n\u003c/search_string>"}],"isRequired":true,"uniqueKey":"oneOf.1.messages","typeLabel":"object[]"},"temperature":{"type":"number","default":0,"description":"Sampling temperature (0.0 recommended for deterministic search)","example":0,"uniqueKey":"oneOf.1.temperature","typeLabel":"number"},"max_tokens":{"type":"integer","description":"Maximum tokens per response","default":2048,"example":2048,"uniqueKey":"oneOf.1.max_tokens","typeLabel":"integer"}},"uniqueKey":"oneOf.1","typeLabel":"Warp Grep · object"}],"uniqueKey":"","typeLabel":"Morph Apply · object | Warp Grep · object"},"examples":{"Example":{"title":"Example","value":{"model":"morph-v3-fast","messages":[{"role":"user","content":"\u003cinstruction>I will add error handling\u003c/instruction>\n\u003ccode>function divide(a, b) {\n return a / b;\n}\u003c/code>\n\u003cupdate>function divide(a, b) {\n if (b === 0) throw new Error('Division by zero');\n return a / b;\n}\u003c/update>"}],"stream":false,"max_tokens":150,"temperature":0}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"1e39476f-d337-4943-8e62-4734c0b45385":{"description":"Chat completion response","content":{"application/json":{"example":{"id":"chatcmpl-123","object":"chat.completion","created":1677652288,"choices":[{"index":0,"message":{"role":"assistant","content":"\ndef calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\n"},"finish_reason":"stop"}],"usage":{"prompt_tokens":25,"completion_tokens":32,"total_tokens":57}},"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the completion","example":"chatcmpl-123","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","description":"Always `chat.completion`","example":"chat.completion","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"created":{"type":"integer","description":"Unix timestamp of when the completion was created","example":1677652288,"isRequired":true,"uniqueKey":"created","typeLabel":"integer"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","description":"Index of the choice in the list","example":0,"isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"message":{"type":"object","properties":{"role":{"type":"string","description":"Author of the generated message, always `assistant`","example":"assistant","uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"string"},"content":{"type":"string","description":"Text generated by the model for this choice","example":"\ndef calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\n","uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string"}},"description":"The message generated by the model","example":{"role":"assistant","content":"\ndef calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\n"},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message","typeLabel":"object"},"finish_reason":{"type":"string","description":"The reason the model stopped generating tokens","example":"stop","isRequired":true,"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"string"}},"required":["index","message","finish_reason"],"description":"A single completion choice returned by the model.","example":{"index":0,"message":{"role":"assistant","content":"\ndef calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\n"},"finish_reason":"stop"},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"description":"List of completion choices","example":[{"index":0,"message":{"role":"assistant","content":"\ndef calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\n"},"finish_reason":"stop"}],"isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt","example":25,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","description":"Number of tokens in the completion","example":32,"uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","description":"Total number of tokens used","example":57,"uniqueKey":"usage.total_tokens","typeLabel":"integer"}},"description":"Usage statistics for the completion request","example":{"prompt_tokens":25,"completion_tokens":32,"total_tokens":57},"isRequired":true,"uniqueKey":"usage","typeLabel":"object"}},"required":["id","object","created","choices","usage"],"description":"Completion returned by a Morph chat model.","example":{"id":"chatcmpl-123","object":"chat.completion","created":1677652288,"choices":[{"index":0,"message":{"role":"assistant","content":"\ndef calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\n"},"finish_reason":"stop"}],"usage":{"prompt_tokens":25,"completion_tokens":32,"total_tokens":57}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"chatcmpl-123","object":"chat.completion","created":1677652288,"choices":[{"index":0,"message":{"role":"assistant","content":"\ndef calculate_total(items):\n total = 0\n for item in items:\n total += item.price\n return total * 1.1 # Add 10% tax\n"},"finish_reason":"stop"}],"usage":{"prompt_tokens":25,"completion_tokens":32,"total_tokens":57}}}},"exampleType":"examples"}},"exampleType":"examples"},"d5c5d624-62f4-4210-82d6-d1aec1c7589a":{"description":"Malformed request — missing or invalid fields.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"invalid_request_error","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","example":"The request body is missing the `model` field.","description":"Human-readable explanation of the failure.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"description":"Standard error envelope returned by every non-2xx response.","example":{"error":{"code":"invalid_request_error","message":"The request body is missing the `model` field."}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"invalid_request_error","message":"The request body is missing the `model` field."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"invalid_request_error","message":"The request body is missing the `model` field."}}}},"exampleType":"examples"}},"exampleType":"examples"},"66223226-ca0b-45d0-b76b-a95da68fd7c8":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"invalid_request_error","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","example":"The request body is missing the `model` field.","description":"Human-readable explanation of the failure.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"description":"Standard error envelope returned by every non-2xx response.","example":{"error":{"code":"invalid_request_error","message":"The request body is missing the `model` field."}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"unauthorized","message":"Invalid API key provided."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"unauthorized","message":"Invalid API key provided."}}}},"exampleType":"examples"}},"exampleType":"examples"},"0d3953fd-2a15-4def-848a-2f0dcb7cf6cb":{"description":"Rate limited — retry after the interval in the Retry-After header.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"invalid_request_error","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","example":"The request body is missing the `model` field.","description":"Human-readable explanation of the failure.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"description":"Standard error envelope returned by every non-2xx response.","example":{"error":{"code":"invalid_request_error","message":"The request body is missing the `model` field."}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"rate_limited","message":"Too many requests. Retry in 12 seconds."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"rate_limited","message":"Too many requests. Retry in 12 seconds."}}}},"exampleType":"examples"}},"exampleType":"examples"},"b6eb94a3-1903-4d84-bf87-2f5be3f16ebe":{"description":"Internal error — safe to retry with backoff.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"invalid_request_error","description":"Machine-readable error code.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","example":"The request body is missing the `model` field.","description":"Human-readable explanation of the failure.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"description":"Standard error envelope returned by every non-2xx response.","example":{"error":{"code":"invalid_request_error","message":"The request body is missing the `model` field."}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"internal_error","message":"Something went wrong on our side."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"internal_error","message":"Something went wrong on our side."}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"ebf75de3-7e2b-4ee9-af3c-8d6c09c1658d":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"opaque","description":"Morph API key, passed as `Authorization: Bearer sk-...`. Create keys at https://www.morphllm.com/dashboard/api-keys.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"05b02330-989f-400f-923d-bb9048118f5a":{"url":"https://api.morphllm.com","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"opaque","description":"Morph API key, passed as `Authorization: Bearer sk-...`. Create keys at https://www.morphllm.com/dashboard/api-keys.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Morph API key, passed as `Authorization: Bearer sk-...`. Create keys at https://www.morphllm.com/dashboard/api-keys.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"morph-555d6c14","siteName":"Morph Documentation","title":"Enterprise Apply - Morph Documentation","contextualStarterQuestions":[],"lastModified":"2026-11-19T22:18:59.506Z","originalFileLocation":"api-reference/endpoint/enterprise.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Enterprise Apply API with custom model configurations\">\u003cmeta data-mint-head name=\"application-name\" content=\"Morph Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Enterprise Apply - Morph Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Enterprise Apply API with custom model configurations\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Morph Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.morphllm.com/api-reference/endpoint/enterprise\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://morph-555d6c14.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Enterprise+Apply\u0026amp;description=Enterprise+Apply+API+with+custom+model+configurations\u0026amp;theme=2a78a8709f2d6f723112079e\u0026amp;signature=8642251fd925fd1c507f31a203ac8905f05ce659c708598261365f913a5d51d0\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Enterprise Apply - Morph Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Enterprise Apply API with custom model configurations\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://morph-555d6c14.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Enterprise+Apply\u0026amp;description=Enterprise+Apply+API+with+custom+model+configurations\u0026amp;theme=2a78a8709f2d6f723112079e\u0026amp;signature=8642251fd925fd1c507f31a203ac8905f05ce659c708598261365f913a5d51d0\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/morph-555d6c14/lHIMsY-nrY1C9Ig1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Morph Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.morphllm.com/api-reference/endpoint/enterprise\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/enterprise.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.morphllm.com/#organization\",\"name\":\"Morph Documentation\",\"url\":\"https://docs.morphllm.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/morph-555d6c14/lwaqk6ujzMJV1czI/logo/light.svg?fit=max\u0026auto=format\u0026n=lwaqk6ujzMJV1czI\u0026q=85\u0026s=cd5a33b1dd765106a68d6f487a1e20f1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.morphllm.com#website\",\"name\":\"Morph Documentation\",\"url\":\"https://docs.morphllm.com\",\"publisher\":{\"@id\":\"https://docs.morphllm.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.morphllm.com/api-reference/endpoint/enterprise#webpage\",\"url\":\"https://docs.morphllm.com/api-reference/endpoint/enterprise\",\"name\":\"Enterprise Apply\",\"description\":\"Enterprise Apply API with custom model configurations\",\"dateModified\":\"2026-11-19T22:18:59.506Z\",\"isPartOf\":{\"@id\":\"https://docs.morphllm.com#website\"}},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.morphllm.com/api-reference/endpoint/enterprise#apireference\",\"headline\":\"Enterprise Apply\",\"name\":\"Enterprise Apply\",\"description\":\"Enterprise Apply API with custom model configurations\",\"url\":\"https://docs.morphllm.com/api-reference/endpoint/enterprise\",\"mainEntityOfPage\":{\"@id\":\"https://docs.morphllm.com/api-reference/endpoint/enterprise#webpage\"},\"dateModified\":\"2026-11-19T22:18:59.506Z\",\"publisher\":{\"@id\":\"https://docs.morphllm.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.morphllm.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Morph Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Morph Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoint/enterprise.md","siteName":"Morph Documentation","nav":{"global":null,"groups":[{"group":"Get Started","public":true,"pages":[{"title":"Introduction","description":"Open-weight coding models on an OpenAI-compatible API","icon":"book-open","href":"/introduction"},{"title":"Quickstart","description":"Run a model, apply edits at 10,500 tok/s, and search code — one OpenAI-compatible API","icon":"rocket","href":"/quickstart"},{"title":"Endpoints","description":"Choose general inference or reserve capacity for a dedicated model endpoint","icon":"plug","href":"/endpoints"},{"title":"General inference","description":"Send requests to Morph models without provisioning an endpoint","icon":"bolt","href":"/general-inference"},{"title":"Dedicated endpoints","description":"Reserve model capacity, send requests, monitor usage, and cancel service","icon":"server","href":"/dedicated-endpoints"},{"title":"Ultra plan","description":"Unlimited Kimi K3.1 and DeepSeek V4.1 Flash for $200 a month, subject to rate limits","icon":"infinity","href":"/ultra-plan"},{"title":"Rate Limits","description":"Per-minute account request and token limits, no concurrency cap, and serving capacity on DeepSeek V4.1 Flash Abliterated and Kimi K3.1 Pro Abliterated","icon":"gauge","href":"/rate-limits"},{"title":"morph CLI","description":"One binary for WarpGrep search, Fast Apply edits, Compact, and chat. Agents call it through their shell.","icon":"terminal","href":"/cli"},{"title":"Agent skills","description":"SKILL.md files that teach Claude Code, Codex, Cursor and OpenCode when to call morph.","icon":"graduation-cap","href":"/skills"},{"title":"Agent Context (llms.txt)","description":"Give your coding agent full Morph context in ~5k tokens","icon":"file-lines","href":"/llm-quickstart"}]},{"group":"Models","public":true,"pages":[{"group":"Open Source Models","icon":"rocket","root":{"title":"Open Source Models","description":"Open-weight models with automatic prefix caching","icon":"rocket","href":"/sdk/components/fast-models"},"pages":[{"title":"Dynamic Tool Loading","description":"Load Kimi K3.1 tool schemas only when an agent needs them","icon":"wrench","href":"/sdk/components/dynamic-tool-loading"},{"title":"Prompt Caching","description":"Automatic prefix caching on every open source model. Cached input at $0.1955/1M on GLM-5.3, with per-request TTL control.","icon":"database","href":"/sdk/components/caching"},{"title":"Standby Requests","description":"50% off Kimi K3.1, GLM-5.3, GLM-5.3-Flash, and DeepSeek V4 Flash for latency-tolerant workloads. Set service_tier: standby and pay half.","icon":"clock","href":"/sdk/components/standby"}]},{"title":"Reflex","description":"Get a decision from text, JSON, or an image. Send a state and a question; read the probabilities.","icon":"bolt","href":"/models/reflex"},{"title":"Fast Apply","description":"AI file editing at 10,500 tokens/s - 1.8x faster, 40% fewer tokens","icon":"bolt","href":"/sdk/components/fast-apply"},{"title":"Compact","description":"Drop filler from chat history at 33,000 tok/s. No rewriting, no paraphrasing.","icon":"compress","og:image":"images/compact.webp","twitter:image":"images/compact.webp","href":"/sdk/components/compact"},{"group":"WarpGrep","icon":"search","root":{"title":"WarpGrep","description":"A code search subagent that finds relevant code in a separate context window. No embeddings, no indexing.","icon":"search","href":"/sdk/components/warp-grep/index"},"pages":[{"group":"Subagent as a Tool","pages":[{"title":"Codebase Search","description":"Search local repositories with WarpGrep","icon":"magnifying-glass","href":"/sdk/components/warp-grep/codebase-search"},{"title":"GitHub Search","description":"Search public GitHub repositories without cloning","icon":"github","href":"/sdk/components/warp-grep/github-search"},{"title":"Streaming","description":"Stream WarpGrep search steps","icon":"bars-staggered","href":"/sdk/components/warp-grep/streaming"}]},{"title":"Examples","description":"Production-ready WarpGrep agent patterns","icon":"code","href":"/sdk/components/warp-grep/examples"},{"title":"Direct API Access","description":"Build your own agent harness around WarpGrep","icon":"code","href":"/sdk/components/warp-grep/direct"},{"title":"Sandbox Execution","description":"Run WarpGrep in remote sandboxes and custom environments","icon":"cloud","href":"/sdk/components/warp-grep/sandbox-execution"}]},{"title":"Model Router","description":"Classifies prompt difficulty, ambiguity, and domain for automatic model selection","icon":"route","og:image":"images/router.jpg","twitter:image":"images/router.jpg","href":"/sdk/components/router"}]},{"group":"API Reference","public":true,"pages":[{"title":"Apply API","description":"Apply code edits at 10,500 tok/s with 98% accuracy via OpenAI-compatible API","openapi":"POST /v1/chat/completions","href":"/api-reference/endpoint/apply"},{"title":"Compact API","description":"Compress chat history and code context at 33,000 tok/s with byte-identical output","openapi":"POST /v1/compact","href":"/api-reference/endpoint/compact"},{"title":"WarpGrep API","description":"Agentic code search subagent that explores repositories in ~6 seconds","openapi":"POST /v1/chat/completions","href":"/api-reference/endpoint/warpgrep"},{"title":"Messages API","description":"Anthropic-compatible /v1/messages endpoint — point an Anthropic SDK at Morph by changing the base URL","openapi":"POST /v1/messages","href":"/api-reference/endpoint/messages"},{"title":"Reflex API","description":"Typed decisions: send a state and named questions, get a probability per answer back. No text generation, no parsing.","openapi":"POST /v1/systemone","href":"/api-reference/endpoint/systemone"},{"group":"Models","pages":[{"title":"List Models","description":"OpenAI-compatible model listing at /v1/models","openapi":"GET /v1/models","href":"/api-reference/endpoint/models"},{"title":"Retrieve Model","description":"Fetch a single model by id at /v1/models/{model}","openapi":"GET /v1/models/{model}","href":"/api-reference/endpoint/retrieve-model"},{"title":"Delete Model","description":"Remove a fine-tuned model at /v1/models/{model}","openapi":"DELETE /v1/models/{model}","href":"/api-reference/endpoint/delete-model"}]},{"group":"Dedicated","pages":[{"title":"List Dedicated Endpoints","description":"Discover your dedicated endpoints at /api/v1/dedicated/endpoints","openapi":"GET /api/v1/dedicated/endpoints","href":"/api-reference/endpoint/dedicated-list"},{"title":"Get Dedicated Endpoint","description":"Fetch one endpoint's lifecycle at /api/v1/dedicated/endpoints/{id}","openapi":"GET /api/v1/dedicated/endpoints/{id}","href":"/api-reference/endpoint/dedicated-get"},{"title":"Cancel Dedicated Endpoint","description":"Cancel service at /api/v1/dedicated/endpoints/{id}/cancel","openapi":"POST /api/v1/dedicated/endpoints/{id}/cancel","href":"/api-reference/endpoint/dedicated-cancel"}]},{"group":"Credits","pages":[{"title":"Create Credit Top-up","description":"Buy credits with USDC from an agent at /api/v1/credits/topups","openapi":"POST /api/v1/credits/topups","href":"/api-reference/endpoint/credits-topup-create"},{"title":"Get Credit Top-up","description":"Check whether a top-up has been paid and credited at /api/v1/credits/topups/{checkoutId}","openapi":"GET /api/v1/credits/topups/{checkoutId}","href":"/api-reference/endpoint/credits-topup-get"}]},{"group":"Account","pages":[{"title":"Get Account Usage","description":"Read your daily usage and spend at /api/v1/account/usage","openapi":"GET /api/v1/account/usage","href":"/api-reference/endpoint/account-usage-get"},{"title":"Get Account Settings","description":"Read your billing settings at /api/v1/account/settings","openapi":"GET /api/v1/account/settings","href":"/api-reference/endpoint/account-settings-get"},{"title":"Update Account Settings","description":"Change extra usage, spend limits and auto-reload at /api/v1/account/settings","openapi":"PATCH /api/v1/account/settings","href":"/api-reference/endpoint/account-settings-update"}]},{"group":"Organization","pages":[{"title":"List Member Budgets","description":"Read every organization member's monthly budget and spend at /api/v1/org/members/budgets","openapi":"GET /api/v1/org/members/budgets","href":"/api-reference/endpoint/org-member-budgets-list"},{"title":"Set Member Budget","description":"Cap a member's monthly spend on your organization's keys at /api/v1/org/members/{userId}/budget","openapi":"PUT /api/v1/org/members/{userId}/budget","href":"/api-reference/endpoint/org-member-budget-set"},{"title":"Remove Member Budget","description":"Remove a member's monthly budget at /api/v1/org/members/{userId}/budget","openapi":"DELETE /api/v1/org/members/{userId}/budget","href":"/api-reference/endpoint/org-member-budget-delete"}]},{"title":"Report API","description":"Report failed or problematic completions to improve Morph model quality","openapi":"POST /api/report","href":"/api-reference/endpoint/report"}]},{"group":"Integrations","public":true,"pages":[{"group":"Guides","icon":"book","pages":[{"title":"Claude Code \u0026 Codex","description":"Run Morph's open models inside Claude Code and Codex","icon":"terminal","href":"/guides/coding-agents"},{"title":"Enterprise Model Routing","description":"Route every Claude Code turn to the right Claude model with an org-wide policy. Configure it in Administration, install it per developer, uninstall in one command.","href":"/guides/enterprise-model-routing"},{"title":"General Prompting","description":"Learn how to use prompt models like Claude, GPT-4o, and Gemini optimized for agentic workflows","icon":"message","href":"/guides/prompting"},{"title":"Agent Tools (edit_file)","description":"Build precise AI agents that edit code fast without full file rewrites using Morph's edit_file tool","icon":"wrench","href":"/guides/agent-tools"},{"title":"XML Tool Calls","description":"Learn why XML tool calls outperform JSON for code editing and how to implement them with Claude and other LLMs","icon":"code","href":"/guides/xml-tool-calls"},{"title":"WarpGrep in Python","description":"Build a complete WarpGrep agent harness in Python","icon":"python","href":"/guides/warp-grep-python"},{"title":"API Reference","description":"Complete MorphClient API and types","icon":"book","href":"/sdk/reference"}]},{"group":"Frameworks","icon":"code","pages":[{"title":"Vercel AI SDK","description":"Stream fast code edits with Morph using the Vercel AI SDK","icon":"triangle","href":"/guides/ai-sdk"},{"title":"Blaxel Sandboxes","description":"Apply edits and execute AI code via tool calls inside a secure sandboxed environment on Blaxel.","icon":"b","href":"/guides/blaxel"},{"title":"Freestyle","description":"How to integrate Morph Fast Apply with Freestyle Dev Servers for lightning-fast AI code editing.","href":"/guides/freestyle"},{"title":"Claude Code","description":"Run Claude Code on Morph models, and add Morph's fast edits and repo search as tools.","href":"/guides/claude-code"}]},{"group":"Legacy","icon":"archive","pages":[{"title":"MCP server (legacy)","description":"The Morph MCP server for hosts that cannot run commands. New installs should use the morph CLI + skills.","icon":"plug","href":"/mcpquickstart"}]}]}]},"basePath":"","title":"Enterprise Apply - Morph Documentation","deploymentId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","buildId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","dynamics":["c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["OpenApiReferenceProvider-D4yvBxwa.js","snippetPresets-CkhhQaIQ.js","utils-XnMGX2lF.js","style-to-object-BY3JEAdk.js","utils-CRXL1dwr.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-DvwRKZnA.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DYtgUc7n.js","_Uint8Array-D8z7zjjJ.js","isObject-FP1Yky1u.js","Page-DQd9HN9r.js","api-description-markdown-BpDftTKT.js","DynamicMarkdown-CZT_WAnN.js","CodeSnippet-C1QlaNYl.js","use-playground-group-access-DyQ_1IIe.js","SectionHeading-K1iuDm9j.js","ApiExamples-RYQSJVS4.js","usePlaygroundInputsStore-k_R_BTDL.js","shallow-BwVhzryZ.js","isEqual-Cx5TQjMc.js","CodeSnippets-BDe2dS5N.js","MethodPill-Dx3JIwHJ.js","getPastedJson-buPTdYs_.js","Check2Icon-DmMrzBYX.js","axios-CsQoIw0U.js","Markdown-erv2ryQz.js","AssistantPageLink-DJ01X1Sn.js","dist-D9mz3EIS.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}