> For the complete documentation index, see [llms.txt](https://docs.aimlapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aimlapi.com/integrations/cline.md). Agents can also search and read this documentation through its [MCP server](https://docs.aimlapi.com/~gitbook/mcp).

# Cline

## About

Cline is an open-source AI coding assistant with two working modes (Plan/Act), terminal command execution, and support for the Model Context Protocol (MCP) in VS Code.

You can find the Cline repository and community on [GitHub](https://github.com/cline).

{% hint style="info" %}
Faster: run `npx aimlapi cline`. It signs you in through the browser and makes AI/ML API Cline's default provider, in both the CLI and the VS Code extension. It replaces an OpenAI Compatible provider you set up by hand; `aimlapi cline --undo` restores it. If you agree, it also connects the AI/ML API MCP server in `cline_mcp_settings.json` and installs four skills. See [CLI](https://docs.aimlapi.com/quickstart/cli.md#cline).
{% endhint %}

## Installing Cline in VS Code

1. Open the **Extensions** tab in the VS Code sidebar.

<figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2Fgit-blob-4f3015a743429973cae02b25cfb9227814e94412%2Ffile-MSoV7yWuiF.png?alt=media" alt=""><figcaption></figcaption></figure>

2. In the search bar, type **Cline**.
3. Find the extension and click **Install**.

<figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2Fgit-blob-8d2380734a9df818597f03c0d7419e521e78b7b0%2Ffile-EtVsh1r3HJ.png?alt=media" alt=""><figcaption></figcaption></figure>

4. After installation, a separate **Cline** tab will appear in the sidebar.

<figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2Fgit-blob-7018954f2c60c1dd3b1348146331e7d992feafea%2Ffile-2M7nFjSF7c.png?alt=media" alt=""><figcaption></figcaption></figure>

## **Configuring Cline**

1. Go to the **Cline** tab in the sidebar.
2. Click the gear icon in the top-right corner.

<figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2Fgit-blob-e0a862f7fa2c871a91ef56b59feb496c48867df4%2Ffile-jxjkvunu8d.png?alt=media" alt=""><figcaption></figcaption></figure>

In the settings, pick one of the two options below.

### Option 1: AI/ML API provider (Cline v4.1.24 and later)

Cline ships **AI/ML API** (provider ID `aimlapi`) in its provider list, generated from the [models.dev](https://docs.aimlapi.com/integrations/models-dev.md) catalog.

* In **API Provider**, search for **AI/ML API** and select it.
* In **Base URL**, make sure the value is `https://api.aimlapi.com/v1`. Enter it if the field is empty.
* In the API key field, enter your [AI/ML API key](https://aimlapi.com/app/keys).
* In **Model ID**, enter an AI/ML API model ID, for example `anthropic/claude-sonnet-5`.
* Click **Save**.

Cline uses the same OpenAI-compatible settings form for this provider, so the API key field may be labeled **OpenAI Compatible API Key**.

### Option 2: OpenAI Compatible provider

Use this on Cline versions before v4.1.24:

* Set **API Provider** to **OpenAI Compatible**.
* In **Base URL**, enter `https://api.aimlapi.com/v1`.
* In **API Key**, enter your [AI/ML API key](https://aimlapi.com/app/keys).
* In **Model ID**, specify the model name. You can find some model selection tips in our [description of code generation as a capability](https://docs.aimlapi.com/capabilities/code-generation.md).
* Click **Save**.

All done, start coding with Cline!

## Usage Example

Here’s the request we made:

```
Create a Python file named test and add code to print Hello, world
```

<figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2Fgit-blob-ffccb4d6a1169d5d5e9ef2e080bdd325784289b7%2Ffile-hUIEu0dwuF.png?alt=media" alt=""><figcaption></figcaption></figure>

If you expand the **API Request** section, you can view the data — including your prompt.

Since I asked to create a file in the request, the file was generated. You can see a preview and its contents, but it hasn’t been saved yet.

To save the file, Cline asks for confirmation.

<figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2Fgit-blob-39a5822c073b775cd6f5de8be6af8c671b0009fa%2Ffile-vI3i1xgY23.png?alt=media" alt=""><figcaption></figcaption></figure>

Once the file is saved, a second API request appears with metadata, along with a notification that the task was successfully completed.

## Model selection

Use exact AI/ML API chat model IDs, for example:

* `anthropic/claude-sonnet-5`: strong for coding
* `openai/gpt-5-5`: strong general use
* `google/gemini-3.6-flash`: lower latency and lower cost

With the AI/ML API provider, Cline suggests models from its copy of the models.dev catalog, which it refreshes at runtime. For the full catalog, use [All Model IDs](https://docs.aimlapi.com/api-references/model-database.md).

## Troubleshooting

Possible Issues:

* **403 status code (no body)** — This is the most common error. Possible causes:
  * The Base URL is not `https://api.aimlapi.com/v1`.
  * The user may have run out of tokens or doesn’t have enough. Check your balance in your account dashboard.
* **400 status code (no body)**: this error usually means the model ID is wrong or the model is not a chat model. Check the ID in [Model selection](#model-selection).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aimlapi.com/integrations/cline.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
