Cline: Claude & GPT via OpenAI-Compatible
This guide needs an API key
Create an account and generate one in about a minute, then use it wherever the steps below expect a key.
No card required to sign up · API usage requires a top-up
Cline is an open-source coding agent for VS Code; add Code By AI as an OpenAI-compatible provider to run Claude and GPT models with one key.
Cline drives files, the terminal and a browser from a side panel. Its OpenAI Compatible provider takes a base URL, an API key and a model ID, so the same Code By AI endpoint can serve both model families.
One command?
setup.sh does not configure Cline. Its provider settings live in one file shared by the VS Code extension, the CLI and a background hub, and an entry Cline cannot validate makes it treat the whole file as empty, which drops every provider, including the Cline sign-in. Use the steps below.
1. Install Cline
Install Cline from the VS Code Marketplace, then open its panel from the activity bar.
2. Open the provider settings
In the Cline panel, click the gear icon and open API Configuration.
3. Configure Code By AI
- API Provider:
OpenAI Compatible - Base URL:
https://www.codebyai.net/api/agent/v1 - API Key:
sk-proj-...from the API Keys page - Model:
gpt-5.6-terra
Click Verify or send a short prompt. Cline expects a base URL, not a full endpoint; it appends /chat/completions itself.
4. Model configuration
Open Model Configuration and set the limits the model advertises:
- Context Window:
200000 - Max Output Tokens:
65536 - Computer Use: leave enabled for models with tool/function calling, so Cline can run its tools
- Image Support: enable only if you send screenshots or images
These are per-model settings in Cline. Matching them to the gateway's limits avoids failed requests or premature truncation.
5. Switch to Claude
Change Model to claude-sonnet-5; the base URL and key stay the same. The gateway forwards claude-* IDs to the Claude channel and bills them at Claude prices, so one provider covers both families. Use the IDs listed on the Model Plaza.
Troubleshooting
404— the Base URL includes/chat/completionsor a second/v1. Usehttps://www.codebyai.net/api/agent/v1.401/ invalid key — the key has stray spaces, was deleted, or expired. Create a new one on the API Keys page.- Insufficient balance — top up on the Wallet page.
- The agent stops calling tools — tool use is disabled in Model Configuration, or the selected ID does not support it. Enable Computer Use and pick an agentic model from the Model Plaza.
- Responses are cut off — raise Max Output Tokens; the gateway's models support up to 65,536 output tokens per request.
Get started
Four steps to your first request
- 01
Create a free account
Sign up with Google, GitHub or email and set a password. No card is required.
- 02
Generate an API key
Create a key in one click from the dashboard. It lets your CLI authenticate with Code By AI.
- 03
Top up your balance
Add credit before your first request; usage is charged per token from your balance.
- 04
Point your CLI at Code By AI
Export one base-URL variable, or add a model provider block to config.toml. The setup guides list the exact lines for each agent.
No card required to sign up · API usage requires a top-up