Skip to main content
Cline exposes two distinct APIs depending on what you want to build:
  • Cline REST API — An OpenAI-compatible HTTP endpoint at api.cline.bot. Send chat messages to any supported model from any language, framework, or tool.
  • VS Code Extension API (ClineAPI) — A TypeScript interface exposed by the Cline VS Code extension. Lets other extensions programmatically start tasks, send messages, and interact with the Cline panel.

Cline REST API

The Cline REST API is an OpenAI-compatible Chat Completions endpoint. Authenticate once with a Cline API key and get access to models from Anthropic, OpenAI, Google, and more through a single base URL. No need to manage separate keys for each provider.
Your app  →  Cline API (api.cline.bot)  →  Anthropic / OpenAI / Google / ...

Base URL

https://api.cline.bot/api/v1

Authentication

All requests require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Get your API key at app.cline.bot under Settings > API Keys.

Quick example

curl -X POST https://api.cline.bot/api/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-4-6",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

VS Code extension API

The Cline VS Code extension exports a ClineAPI interface that other extensions can use to control the Cline panel programmatically. This is intended for extension authors building editor integrations.
export interface ClineAPI {
  // Start a new task with an optional message and images
  startNewTask(task?: string, images?: string[]): Promise<void>

  // Send a message to the active task
  sendMessage(message?: string, images?: string[]): Promise<void>

  // Simulate clicking the primary action button
  pressPrimaryButton(): Promise<void>

  // Simulate clicking the secondary action button
  pressSecondaryButton(): Promise<void>
}
Access the API from another VS Code extension:
const clineExtension = vscode.extensions.getExtension('saoudrizwan.claude-dev')
const cline: ClineAPI = clineExtension?.exports

await cline.startNewTask('Refactor this module to use async/await')
The ClineAPI is only available in the VS Code extension context. It does not apply to the REST API, the CLI, or JetBrains.

REST API reference

Authentication

API keys, security best practices, and environment variable setup.

Chat completions

Full endpoint reference — parameters, streaming, tool calling, and response format.

Errors

Error codes, mid-stream errors, and retry strategies.

Models

Browse available models, free tiers, and selection guidance.

Build docs developers (and LLMs) love