# Cline

Cline treats The Grid as an ordinary OpenAI-compatible provider. No plugin, no proxy. Three fields in the settings panel and the agent runs on market-priced inference.

## Prerequisites

* Cline installed in VS Code from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev). Cursor users can install the same extension from Cursor's extension panel.
* A Grid account at [app.thegrid.ai](https://app.thegrid.ai).
* Credits in your account. The Grid is prepaid; zero credits returns 402.
* A Grid consumption API key from **Settings → API Keys → Create Consumption Key**. Trading keys are rejected by the inference API.

## Setup

### 1. Open the Cline settings panel

In VS Code or Cursor, click the gear icon in the Cline sidebar. Under **API Configuration**, open the **API Provider** dropdown and select **OpenAI Compatible**.

### 2. Fill in the three fields

| Field                     | Value                                  |
| ------------------------- | -------------------------------------- |
| Base URL                  | `https://api.thegrid.ai/v1`            |
| OpenAI Compatible API Key | your Grid consumption key              |
| Model ID                  | an instrument name, e.g. `agent-prime` |

The Model ID field is free text. Type the instrument name exactly as published in the [current instruments list](/docs/instrument-specifications/current-instruments.md). A typo surfaces as 404 on the first message.

### 3. Pick an instrument for your workload

Cline runs an agent loop (file reads, edits, terminal, MCP tools), which rewards Agent and Code instruments. Start with `agent-prime` for general work, `code-prime` if you mostly write code, and reach for the Max tier on Plan mode or genuinely hard tasks. Full tier guidance lives in the [current instruments list](/docs/instrument-specifications/current-instruments.md).

### 4. (Optional) Split Plan and Act

Enable **Use different models for Plan and Act modes** in Cline settings to route Plan mode to a stronger instrument. A common pattern: `agent-max` for Plan, `agent-prime` for Act.

### 5. (Optional) Tune reasoning effort

If the **Reasoning Effort** selector appears for your chosen instrument, `medium` is a good default for agent loops. Raise to `high` for hard reasoning, drop to `low` for cheap high-volume execution.

## Verification

Open a new Cline task and ask it to do something concrete: "Create a health check endpoint in Express at `/health` and add a test." If Cline reads the workspace, writes the file, and finishes without 401 or 402, the integration is live.

## Troubleshooting

{% hint style="warning" %}
**401 Unauthorized.** You're using a Grid trading key, not a consumption key. Create a consumption key in your Grid dashboard and paste it again. Whitespace at the end of a pasted key also causes 401.
{% endhint %}

{% hint style="warning" %}
**402 Payment Required.** Your credits are at zero. Top up at [app.thegrid.ai](https://app.thegrid.ai). Auto Top Up should prevent this in normal use; check that your payment method is valid.
{% endhint %}

{% hint style="warning" %}
**404 model\_not\_found.** You typed the Model ID incorrectly. The field is free text and Cline does not validate. See the [current instruments list](/docs/instrument-specifications/current-instruments.md) for valid IDs.
{% endhint %}

{% hint style="info" %}
**Plan/Act settings drifting between modes.** Older Cline versions had a sync bug on the OpenAI Compatible provider. Update Cline to the latest Marketplace release.
{% endhint %}

{% hint style="info" %}
**Cost tracker shows $0.** Expected. The Grid uses market-based pricing that varies per fill, and Cline's cost tracker reads only the static price fields in **Model Configuration**. Track real spend in your Grid dashboard.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thegrid.ai/docs/integrations-and-best-practices/integrations/cline.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
