Documentation
How to connect ChatGPT to Cline
Last updated:
Setting up Cline to work with ChatGPT takes a couple of minutes: pick the OpenAI Compatible provider, paste your key and our base URL, and the agent starts reaching OpenAI models through ChatGPT API.
What Cline is
Cline calls itself the open coding agent: a VS Code extension under Apache 2.0 with close to 5M installs on the VS Code marketplace. It does not sell you a model - the key and the provider are yours, any OpenAI-compatible endpoint included, which is why connecting ours comes down to three fields in the settings.
Open, no vendor lock-in
Apache 2.0 and your own key: Cline does not resell tokens and does not tie you to one provider.
Plan and Act modes
Agree on a plan first, then let the agent execute it - approve each step by hand or switch auto-approve on.
Diffs and checkpoints
Every change shows up as a diff, with checkpoints and one-click undo when the agent takes a wrong turn.
Terminal and MCP
It runs commands and reacts to their output, and its toolset extends through MCP servers and plugins.
What you need
- VS Code with the Cline extension installed
- A ChatGPT API key from the dashboard - sign-up comes with $0.25 of balance to test with
- A project you want to run the agent in
Setting up Cline
1. Install Cline
Install the extension from the VS Code marketplace - or head to the project repository first if you want to read the source.
Cline
Clinecline.bot|↓ 4,909,518|★★★★★(307)
Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.
2. Bring your own key
On first launch Cline asks how you plan to use it. Pick Bring my own API key and press Continue - that is the mode where requests go to your provider.
✓ Bring my own API key
Use Cline with your provider of choice
3. Fill in the provider settings
Open API Configuration and fill in four fields. The provider has to be OpenAI Compatible - that is the one that can talk to a third-party base URL.
Settings
DoneAPI Configuration
API Provider
Base URL
OpenAI Compatible API Key
This key is stored locally and only used to make API requests from this extension.
Model ID
Custom Headers
Add Header4. Done
Press Done and ask the agent your first question. Requests go through ChatGPT API, usage shows up in the dashboard, and the model can be changed in the settings at any time.
What can I do for you?
Type your task here...
Type @ for context, / for slash command...
➤FAQ
Do I need a paid Cline plan?
No. Cline is open and free; you only pay for tokens from the provider you choose. Sign-up here comes with $0.25 of balance so you can test the setup before topping up.
Cline returns 401 or cannot find the model
Check three things: the provider is set to OpenAI Compatible, the base URL ends in /v1, and the Model ID is spelled exactly as on the models page - gpt-5.6-sol, for example.
Which models are available in Cline through ChatGPT API?
Everything we serve over the API: the GPT-5.6 family (sol, terra, luna) plus GPT-5.5, GPT-5.4 and GPT-5.4-mini. Change the model in the Model ID field.
How is this different from an official OpenAI key?
Same models, same request format - only the base URL and the key change. The difference is price: the same tokens cost 50% less than official list price.
Next steps
Cline is connected. Now pick the model that fits your work and see what it costs.