---
title: "Cline Custom Provider Setup: Add Any OpenAI-Compatible API"
description: "Add Haimaker, Ollama, OpenRouter, or any OpenAI-compatible API to Cline using the OpenAI Compatible provider. Includes Base URL and API key setup, the Model Configuration fields that custom endpoints require, and fixes for the common errors."
date: 2026-06-25
location: San Francisco, CA – Jun 25th, 2026
image: /images/cline-custom-provider-setup-hero.jpg
unlisted: true
keywords: "cline custom provider, cline openai compatible, cline add provider, cline model provider, cline custom api, cline haimaker, cline llm provider, cline base url, cline openrouter"
faq:
  - question: "How do I add a custom provider to Cline?"
    answer: "Open Cline's settings (gear icon), set API Provider to 'OpenAI Compatible', then enter the Base URL and API Key from your provider and the exact Model ID. Open Model Configuration to set the Context Window and Max Output Tokens, and toggle Computer Use on for agentic coding. Click Verify, then send a test prompt before using it on real code. For Haimaker specifically, 'npx -y @haimaker/connect --cline' writes this provider config for you."
  - question: "Why does my custom Cline model give bad output or fail tool calls?"
    answer: "For OpenAI Compatible providers, Cline cannot auto-detect model capabilities, so it falls back to defaults. The usual causes are a Context Window or Max Output Tokens left at the wrong value, the Computer Use toggle left off for an agentic model, or a Model ID that does not match what the upstream API expects. Set those three correctly first."
  - question: "Does Cline support OpenAI-compatible APIs like Haimaker, Ollama, or OpenRouter?"
    answer: "Yes. Cline's 'OpenAI Compatible' provider works with any API that speaks the OpenAI chat completions format. Point the Base URL at the provider's endpoint (for example https://api.haimaker.ai/v1 for Haimaker or http://localhost:11434/v1 for Ollama) and Cline routes requests there."
---

Cline ships with first-class support for the big providers, and at ~64K GitHub stars it is one of the most-used coding agents in VS Code and JetBrains. But the built-in list is not the whole story. The "OpenAI Compatible" provider is how you point Cline at a gateway, a local runtime, an internal inference endpoint, or a model that has not landed in the directory yet.

The flow is short: choose the OpenAI Compatible provider, paste a Base URL and API key, name the model, set a couple of capability fields, and verify. The one step people skip is the Model Configuration block, which matters more for custom endpoints than it does for built-in providers.

> **Just want Haimaker in Cline?** Skip the manual settings — run `npx -y @haimaker/connect --cline` and the CLI writes Cline's OpenAI Compatible provider config (endpoint, key, and model) for you, then exits. The walkthrough below is the general method for *any* OpenAI-compatible endpoint — Ollama, LM Studio, an internal gateway, or a model not yet in the directory. See the [connect guide](/connect) for the one-command path.

## When to use a custom provider

Reach for the OpenAI Compatible provider when the model or endpoint is not already in Cline's built-in list, or when you want to route several model families through one key.

Good examples:

- **Haimaker** — one API key for multiple model families through an OpenAI-compatible gateway.
- **Ollama** — local models at `http://localhost:11434/v1`.
- **LM Studio** — local models at `http://127.0.0.1:1234/v1`.
- **Internal gateways** — company-hosted OpenAI-compatible endpoints.
- **New providers** — anything that speaks the OpenAI chat completions API before Cline's directory catches up.

If the provider already has a dedicated entry in Cline, start there. The OpenAI Compatible path is most useful when you need a custom Base URL, a gateway, or a model that the default options do not expose.

## Step 1: Open settings and pick the provider

Click the gear icon in the Cline panel to open settings. Under **API Provider**, select **OpenAI Compatible**.

This switches the form to the generic OpenAI-compatible fields: a Base URL, an API Key, a Model field, and a Model Configuration section. Everything else on this screen keys off those values.

## Step 2: Enter the Base URL and API key

Fill in the two connection fields:

- **Base URL** — the provider's API endpoint. For [Haimaker](https://haimaker.ai), that is `https://api.haimaker.ai/v1`. Cline accepts both the version-prefixed base (`https://api.provider.com/v1`) and, for some providers, the full chat-completions URL. When in doubt, use the `/v1` base.
- **API Key** — the secret key from your provider. Paste the raw key with no `Bearer` prefix.

There is also a **Use Azure Identity Authentication** checkbox. Leave it unchecked for standard API-key providers like Haimaker or Ollama. It only applies to Azure deployments where you authenticate with `az login` instead of a key.

## Step 3: Set the Model ID

In the **Model** field, enter the exact model identifier the provider expects in the `model` field of a request. Custom providers pass this string through unchanged, so it has to match the upstream API character for character.

For Haimaker, that looks like:

```text
anthropic/claude-sonnet-4-6
openai/gpt-5.4-mini
minimax/minimax-m2.5
qwen/qwen3-coder
```

If you are unsure of the exact string, list the provider's models first (see the verification step below).

## Step 4: Fill in Model Configuration

This is the step that trips people up. For built-in providers, Cline already knows each model's context window, output limit, and whether it supports tool calls. For an OpenAI Compatible provider it cannot detect any of that, so it falls back to conservative defaults that often do not match your model.

Open **Model Configuration** and set:

- **Context Window** — the model's real input limit. If this is too low, Cline truncates context early; too high and you get upstream errors on long sessions.
- **Max Output Tokens** — the per-response output cap.
- **Image Support** — turn on only if the model is multimodal.
- **Computer Use** — turn this **on** for any model you want to drive agentic edits, file operations, and tool calls. With it off, Cline treats the model as chat-only and agentic actions silently fail.
- **Input Price / Output Price** — the provider's per-million-token rates, used for Cline's running cost estimate. These are for display only and do not affect requests, so set them to whatever your provider currently charges.

Getting the Context Window and Computer Use fields right resolves most "the model is connected but acts broken" reports.

## Step 5: Verify and test

Click **Verify** to confirm the Base URL, key, and model resolve. Then send a small prompt in a throwaway task before pointing Cline at real code.

If Verify fails, the problem is almost always the Base URL, the key, or the Model ID, in that order. You can isolate it by hitting the API directly:

```bash
curl https://api.haimaker.ai/v1/models \
  -H "Authorization: Bearer your-haimaker-api-key"
```

A clean JSON list back means your credentials and endpoint are good, and the issue is in the Cline form. Use the exact `id` values from that response in the Model field.

## Full example: Haimaker gateway

This is the setup to use when you want one OpenAI-compatible endpoint for several model families:

| Field | Value |
| --- | --- |
| API Provider | OpenAI Compatible |
| Base URL | `https://api.haimaker.ai/v1` |
| API Key | your Haimaker key |
| Model | `anthropic/claude-sonnet-4-6` |
| Context Window | match the model (for example 200000) |
| Max Output Tokens | a sane cap (for example 8192) |
| Computer Use | On |

Why this works well: Cline sees one provider, while Haimaker handles access to multiple upstream model families behind a single key. To switch models, you change the Model field (or save a second profile) instead of juggling separate provider credentials. The same key gives you a [wide range of models](https://haimaker.ai/models), so you can move from a budget model for routine edits to a premium model for hard refactors without re-authenticating.

## Full example: Ollama local provider

Ollama exposes an OpenAI-compatible endpoint on your machine, which makes it a clean fit for the same provider type:

| Field | Value |
| --- | --- |
| API Provider | OpenAI Compatible |
| Base URL | `http://localhost:11434/v1` |
| API Key | any non-empty string (Ollama does not validate it) |
| Model | `qwen3-coder:30b` |
| Computer Use | On |

Pull the model before you point Cline at it:

```bash
ollama pull qwen3-coder:30b
```

Confirm the exact tag with `ollama list` and use that string in the Model field. Local models are more sensitive to context limits and tool-call formatting, so start with one that handles agentic coding well, such as Qwen3 Coder, and keep the Context Window modest until tool calls behave.

## Common errors and fixes

#### Verify fails immediately

The Base URL or key is wrong. Confirm the URL ends at `/v1` (not `/v1/chat/completions` unless your provider requires the full path), and that you pasted the key with no `Bearer` prefix and no trailing whitespace. Test with the `curl` command above to isolate Cline from your credentials.

#### Model connects but every agentic action fails

**Computer Use** is off. Cline is treating the model as chat-only, so file edits and tool calls never fire. Turn it on in Model Configuration. If it is already on and tool calls still fail, the model itself may be weak at structured tool use; switch to a model known for agentic coding.

#### Output gets truncated or context errors appear on long tasks

The **Context Window** or **Max Output Tokens** value does not match the model. Cline used a default. Set both to the model's real limits.

#### Requests hit the wrong model or 404

The **Model ID** does not match what the upstream API expects. Custom providers pass it through verbatim, so `anthropic/claude-sonnet-4-6` and `claude-sonnet-4-6` are different strings to the API. Copy the exact `id` from the provider's `/models` response.

#### Cost estimate looks wrong

The **Input Price / Output Price** fields are display-only estimates you entered by hand. They never affect requests or billing. Update them to your provider's current rates if you want the in-session estimate to track reality.

## The practical setup

For most Cline users, a clean two-or-three provider setup covers everything:

1. **Haimaker** for cloud models and one-key routing across families.
2. **Ollama** for local, private work.
3. **One premium model** kept on hand for hard debugging and multi-file refactors.

That gives you local privacy when it matters, low-cost cloud models for routine work, and a stronger model when the task is expensive in attention, all from the same OpenAI Compatible provider type.

<a href="https://app.haimaker.ai/sign-up?utm_source=openclaw_blog&utm_medium=cta&utm_campaign=cline_custom_provider" class="cta-button">USE HAIMAKER WITH CLINE</a>

---

*Setting up a different agent? See [OpenCode Custom Provider Setup](/blog/opencode-custom-provider-setup/) and [OpenClaw Custom Provider Setup](/blog/openclaw-custom-provider-setup/) for the same pattern in those tools. For help picking a model to point at, see [Best Models for OpenClaw](/blog/best-models-for-openclaw/).*
