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.
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.
Recommended models
| Use case | Model | Pricing | Live status |
|---|---|---|---|
| Everyday coding, best balance of speed and quality | claude-sonnet-4-6 | Price | Availability and latency |
| Complex refactors and long tasks | claude-opus-4-6 | Price | Availability and latency |
| Cheap and fast for small edits | claude-haiku-4-5 | Price | Availability 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.
Option 1: OpenAI Compatible (recommended for flexibility across vendors)
-
Set API Provider to "OpenAI Compatible".
-
Enter the Base URL:
https://modelsok.com/v1 -
Paste your Models Hub key into API Key.
-
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)
-
Set API Provider to "Anthropic".
-
Enable "Use custom base URL" and enter:
https://modelsok.comNote this path does not include
/v1, unlike Option 1. -
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
| Symptom | Cause | Fix |
|---|---|---|
401 / Invalid API key | Incomplete key, stray whitespace, or a disabled token | Re-copy from the Tokens page |
| No response, or a connection error | Wrong base URL, most often mixing up /v1 between the two options | OpenAI Compatible uses https://modelsok.com/v1; Anthropic uses https://modelsok.com with no /v1 |
model not found / model unavailable | Misspelled model name, or the token's group can't access it | Check the pricing page |
429 | Rate limited by concurrency | Retry shortly; contact support for a higher limit if it persists |
| Nothing shows in usage logs | Wrong provider selected, or settings weren't saved | Reopen 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.
Related
- CLI one-command setup: for terminal tools that support one-command configuration
- Model pricing and model status
- Cursor setup, Chatbox setup
Use Cursor with Models Hub: Custom Base URL for Claude and GPT
Connect Cursor to Models Hub via Override OpenAI Base URL and call Claude, GPT and other models with one API key. Includes model names, verification and fixes for 'does not work with your current plan'.
Use OpenCode with Models Hub: /connect and opencode.json
Add Models Hub to OpenCode interactively with /connect, or edit opencode.json to declare Anthropic and OpenAI-compatible providers, with verification and error troubleshooting.