What Is Cline?
Cline is an open-source AI coding agent. It started as a VS Code extension (originally called "Claude Dev"), and has expanded to JetBrains, Zed, Neovim, and the terminal. You describe a task in natural language, Cline breaks it into steps, edits files, runs commands, and asks for your approval at each step.
What makes Cline different from simpler code completion tools: it operates as a full agent loop. It reads your codebase, plans changes across multiple files, executes commands, reads output, and iterates. It supports MCP (Model Context Protocol) servers for extending its capabilities with custom tools.
Cline is free. You bring your own API key from Anthropic, OpenAI, Google, or any OpenAI-compatible provider. The extension itself is open source under Apache 2.0.
Does Cline Have an API?
Yes, but probably not the kind you expect. Cline has two things that could be called an "API":
Cline API (LLM Router)
An OpenAI-compatible Chat Completions endpoint at api.cline.bot. One API key gives you access to Claude, GPT, Gemini, DeepSeek, and other models. This is a model gateway, not access to Cline's agent capabilities.
Cline CLI 2.0 (gRPC API)
A terminal-based agent with a gRPC API for scriptable automation. Supports headless mode for CI/CD, parallel agents, and JSON output. This runs the full Cline agent, but as a process you spawn, not a REST endpoint you call.
What the Cline API Is Not
The Cline API does not give you programmatic access to Cline's agent loop, file editing, codebase search, or tool execution. It is a multi-provider LLM gateway. If you want to call "edit this file" or "search this codebase" as API endpoints, you need different infrastructure.
The Cline CLI's gRPC API is closer to what developers want for automation, but it runs a full agent instance. For tasks where you need a specific capability (apply an edit, search code, run a command in a sandbox), running an entire agent is overhead.
What People Actually Want When They Search "Cline API"
Based on GitHub discussions, issues, and forum posts, "cline api" searches map to three distinct needs:
Configure an LLM Provider
You want to point Cline at a specific model or API endpoint. This is built into Cline's settings: select a provider, enter your key, choose a model. No external API needed.
Automate Cline in CI/CD
You want Cline to run headlessly in a pipeline. Cline CLI 2.0 supports this with --yolo mode and JSON output. But you're running a full agent process, not calling a lightweight API.
Build Custom Coding Tools
You want the capabilities Cline has (edit code, search codebases, execute commands) as APIs you can call from your own application. This is where Cline falls short and standalone APIs fill the gap.
The first two are solved by Cline itself. The third requires decomposing what a coding agent does into individual API calls: a fast-apply model for edits, a search tool for codebase navigation, and a sandbox for execution.
Configuring Cline's LLM Provider
If you just need to set up Cline with a specific API key, here is how it works. Cline supports direct connections to Anthropic, OpenAI, Google, AWS Bedrock, Azure, and any OpenAI-compatible endpoint.
Using a Direct Provider
Open the Cline sidebar in VS Code. Click the settings gear icon. Select your provider (e.g., Anthropic). Paste your API key. Choose a model. Done.
Using an OpenAI-Compatible Endpoint
For custom providers, local models (Ollama, LM Studio), or API gateways, select "OpenAI Compatible" as the provider. Set the base URL, API key, and model ID. The model ID often needs a provider prefix (e.g., anthropic/claude-sonnet-4-20250514) depending on the gateway.
Cline with Morph as OpenAI-Compatible Provider
// In Cline settings:
// Provider: OpenAI Compatible
// Base URL: https://api.morphllm.com/v1
// API Key: your-morph-api-key
// Model ID: morph-v3-fast
// This routes Cline's requests through Morph's endpoint.
// Note: morph-v3-fast is optimized for edit merging,
// not general reasoning. For a primary Cline model,
// use Claude or GPT through their direct providers.Using the Cline API (LLM Router)
Cline's own API at api.cline.bot is another option. Get a key from app.cline.bot, set it as your provider, and access multiple models through one endpoint. This is convenient if you want a single key for Claude, GPT, and Gemini without managing separate provider accounts.
Building Coding Tools Programmatically
If you want to build something that does what Cline does, not use Cline as a product, you need the primitives that coding agents are built on.
Every coding agent (Cline, Cursor, Claude Code, Aider) follows the same loop: search the codebase for context, reason about what to change, apply edits to files, then verify the result. Cline bundles all of these into a single agent process. To build your own tools, you need each step as a callable API.
Why Not Just Run Cline Headlessly?
You can. Cline CLI 2.0's headless mode works in CI/CD. But there are tradeoffs:
- You run a full agent for every task, even simple ones. Applying a single edit doesn't need an agent loop with tool calls and multi-turn reasoning.
- Latency adds up. An agent loop that takes 4-5 turns of reasoning to apply a known edit is slower than a direct API call that takes milliseconds.
- Cost scales with reasoning tokens. If you already know what edit to make (from a code review bot, a linter fix, a template expansion), paying for reasoning tokens is waste.
- Cline's gRPC API is not a stable, versioned REST API designed for integration. It's an internal protocol for the CLI frontend.
For workflows where the agent loop is the point (complex multi-file refactors, exploratory coding), running Cline headlessly makes sense. For specific operations (apply this diff, search for this pattern, run this test), standalone APIs are faster, cheaper, and simpler to integrate.
Morph's API Stack: Coding Agent Infrastructure
Morph provides the three primitives that coding agents need, each as a standalone API. Use them individually or compose them into a custom agent.
Fast Apply API
The core edit operation. Send original code and a set of changes, get back the merged file. The morph-v3-fast model is purpose-built for edit merging: insertions, deletions, partial rewrites, multi-region edits. It handles the formatting preservation and context-aware merging that general-purpose LLMs get wrong.
This is the same operation Cline performs internally when it edits a file, except exposed as a direct API call. No agent loop, no multi-turn reasoning. One request, one response.
Fast Apply API Call
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.morphllm.com/v1",
apiKey: process.env.MORPH_API_KEY,
});
const response = await client.chat.completions.create({
model: "morph-v3-fast",
messages: [
{
role: "user",
content: `<code>
${originalCode}
</code>
<update>
${llmGeneratedChanges}
</update>`,
},
],
});
const updatedCode = response.choices[0].message.content;WarpGrep (Agentic Code Search)
Finding relevant code before editing it. WarpGrep runs 8 parallel tool calls per turn across 4 turns, completing a full codebase search in under 6 seconds. It reads directory structures, greps for patterns, reads file contents, and narrows results across multiple rounds.
Cognition (the team behind Devin) measured that 60% of their agent's time went to code search. Better search means fewer wasted LLM tokens and faster task completion. WarpGrep is available as an MCP server or direct API.
WarpGrep MCP Configuration
{
"mcpServers": {
"warpgrep": {
"command": "npx",
"args": ["-y", "@anthropic/warpgrep-mcp"],
"env": {
"MORPH_API_KEY": "your-api-key"
}
}
}
}Sandbox SDK
Isolated execution environments for running generated code. Each sandbox gets its own filesystem, process space, and network policy. Start a sandbox, write files, run commands, read output, tear it down. Built for CI/CD pipelines, code review bots, and any workflow where you need to execute untrusted code safely.
Cline vs Morph API: When to Use Which
These are not competing products. Cline is a coding agent. Morph provides infrastructure APIs. The question is whether you need the agent or the primitives.
| Cline | Morph API | |
|---|---|---|
| What it is | AI coding agent (VS Code + CLI) | Coding infrastructure APIs |
| API type | LLM router + gRPC (CLI) | REST (OpenAI-compatible) |
| Code editing | Agent applies edits via LLM | Fast Apply: 10,500 tok/s, purpose-built model |
| Code search | Local codebase indexing | WarpGrep: 8 parallel calls, <6s |
| Execution | Local terminal | Sandbox SDK (isolated environments) |
| CI/CD use | Headless mode (full agent) | Direct API calls (lightweight) |
| Pricing | Free + LLM API costs | $0.50/M tokens (Fast Apply) |
| Best for | Interactive coding sessions | Building custom tools and pipelines |
Use Cline when you want an interactive coding assistant in your editor. Use Morph's APIs when you want to build something: a code review bot that applies fixes automatically, a CI pipeline that refactors code before merge, a custom IDE with AI editing, or an internal developer tool with coding capabilities.
You can also use both together. Run Cline for interactive work and call Morph's Fast Apply from your own scripts for batch operations. WarpGrep works as an MCP server inside Cline, giving it better search capabilities.
Frequently Asked Questions
Does Cline have an API?
Cline has two APIs. The Cline API (api.cline.bot) is an OpenAI-compatible LLM router: one API key, access to Claude, GPT, Gemini, and more. Cline CLI 2.0 exposes a gRPC API for headless automation and CI/CD. Neither provides a lightweight REST API for specific coding operations like "apply this edit" or "search this codebase." For that, use Morph's APIs.
How do I configure an API key in Cline?
Open the Cline sidebar in VS Code, click the settings icon, select your provider (Anthropic, OpenAI, Google, OpenRouter, or OpenAI Compatible), and enter your API key. For OpenAI-compatible providers, you also set the base URL and model ID.
Can I use Cline in CI/CD pipelines?
Yes. Cline CLI 2.0 supports headless mode with the --yolo or --no-interactive flag for fully autonomous operation. The --json flag streams structured output for programmatic consumption. This works in GitHub Actions, GitLab CI, Jenkins, and any environment that can run a Node.js process.
What is the difference between Cline's API and Morph's API?
Cline's API is an LLM router that gives you access to multiple model providers through one endpoint. Morph's API provides specialized coding infrastructure: Fast Apply for code edits at 10,500 tok/s, WarpGrep for agentic code search, and Sandbox SDK for execution. Different layers of the stack.
How do I build a coding agent like Cline?
A coding agent needs four capabilities: codebase search (find relevant files), reasoning (decide what to change), code editing (apply changes to files), and execution (run and verify). Use WarpGrep for search, a foundation model (Claude, GPT) for reasoning, Morph Fast Apply for edits, and Sandbox SDK for execution. See our guide to building coding agents.
Is Cline free?
The Cline VS Code extension and CLI are free and open source (Apache 2.0). You pay for the LLM API calls, either through your own provider keys or through Cline's API. Team features cost $20/month per seat after Q1 2026, with the first 10 seats free.
Can I use Morph's Fast Apply with Cline?
You can configure Cline to use Morph as an OpenAI-compatible provider (base URL: https://api.morphllm.com/v1). The morph-v3-fast model is optimized for edit merging, not general reasoning, so it works best for the apply step rather than as Cline's primary model. Most teams use Claude or GPT for reasoning and Morph for the fast-apply step in their own pipelines.
What is Cline CLI 2.0?
A terminal-based version of the Cline coding agent, released in 2026. It runs as a standalone Node.js process with a gRPC API, supporting parallel agents, headless CI/CD pipelines, and ACP (Agent Communication Protocol) for multi-editor support. It can operate in interactive or fully autonomous mode.
Related Pages
Build with Morph API
Fast Apply at 10,500 tok/s. WarpGrep for agentic code search. Sandbox SDK for isolated execution. The infrastructure behind coding agents like Cline, available as APIs.