Models Hub
Agent Tools

Use Cline with Models Hub: OpenAI Compatible and Anthropic Setup

Connect the VS Code extension Cline to Models Hub via either OpenAI Compatible or Anthropic provider, with field details, verification steps, and error troubleshooting.

Edit this page

Cline is a VS Code extension that acts as an autonomous coding agent: it reads and writes files, runs terminal commands, and plans multi-step tasks on its own. You can swap its model source for any compatible service. Point the provider at Models Hub and Cline's chat, code generation, and terminal actions all draw on your Models Hub balance. This page covers the connection only, not how to use Cline itself.

Three things you need

A Models Hub API key, a base URL (differs by method, see below), and a model name. Pick one of the two providers below.

Prerequisites

  • Cline installed. Search "Cline" in the VS Code Extensions marketplace, or see the official docs.
  • A Models Hub API key from the Tokens page, in a group that can access the models you want.
Use caseModelPricingLive status
Everyday coding, best balance of speed and qualityclaude-sonnet-4-6PriceAvailability and latency
Complex refactors and long tasksclaude-opus-4-6PriceAvailability and latency
Cheap and fast for small editsclaude-haiku-4-5PriceAvailability and latency

Model names are authoritative on the pricing page.

Setup

Open settings via the gear icon in the top-right of the Cline panel, or run Cline: Open In New Tab from the command palette (Cmd/Ctrl+Shift+P) for a full tab. Pick either provider below in the API Provider dropdown.

  1. Set API Provider to "OpenAI Compatible".

  2. Enter the Base URL:

    https://modelsok.com/v1
  3. Paste your Models Hub key into API Key.

  4. Enter the model name in Model, e.g. claude-sonnet-4-6. Note: Cline's own docs label this field "Model", though some versions show "Model ID" in search summaries; trust the control you actually see in your version.

Option 2: Anthropic (simpler if you only use Claude models)

  1. Set API Provider to "Anthropic".

  2. Enable "Use custom base URL" and enter:

    https://modelsok.com

    Note this path does not include /v1, unlike Option 1.

  3. API Key and Model work the same way; use a Claude model name such as claude-sonnet-4-6.

Verify

Ask Cline something like "describe this project in one sentence". A normal reply with no error dialog means you're connected. Then check Usage logs in the Models Hub console; a request under your configured model name appears within seconds, confirming traffic went through Models Hub.

Common errors

SymptomCauseFix
401 / Invalid API keyIncomplete key, stray whitespace, or a disabled tokenRe-copy from the Tokens page
No response, or a connection errorWrong base URL, most often mixing up /v1 between the two optionsOpenAI Compatible uses https://modelsok.com/v1; Anthropic uses https://modelsok.com with no /v1
model not found / model unavailableMisspelled model name, or the token's group can't access itCheck the pricing page
429Rate limited by concurrencyRetry shortly; contact support for a higher limit if it persists
Nothing shows in usage logsWrong provider selected, or settings weren't savedReopen settings and confirm Provider, Base URL, and Key are all saved

More in Troubleshooting.

FAQ

How is it billed? Per input and output token actually consumed, at the price on each model's pricing page. Usage logs itemize every request.

Which provider should I pick? Anthropic is simpler if you only use Claude models, since the base URL skips /v1. Pick OpenAI Compatible if you might mix in other vendors' models later. Both draw from the same Models Hub account and balance.

How do I switch models? Edit the Model field in settings and save, or use the model picker at the top of the Cline chat panel if your version has one.

On this page