AdaptorsOpenAI SSE Adaptor
Connect Cline
Route Cline to any ModelWorks circuit as a custom model provider via the OpenAI SSE adaptor.
Connect Cline to ModelWorks
Cline is an autonomous coding agent for VS Code with 72K+ GitHub stars. This guide shows you how to connect Cline to any circuit on ModelWorks.
Prerequisites
- Cline installed in VS Code
- A ModelWorks account — sign up
- A ModelWorks API key — from Settings → Security Tokens
Step 1: Get your adaptor URL
Every circuit with an OpenAI SSE adaptor exposes a URL like:
https://modelworks.ai/api/circuit-adaptors/ca-xxxxxxxxxxxxxxxxx/queryStep 2: Configure Cline
Open the Cline panel in VS Code → click the settings icon → API Provider → select OpenAI Compatible:
- Base URL:
https://modelworks.ai/api/circuit-adaptors/ca-xxxxxxxxx/query - API Key:
mw_YOUR_API_KEY - Model ID:
glm-53-abliterated
Step 3: Run your first circuit
Open a file in VS Code and ask Cline to do something. The circuit runs on ModelWorks and Cline receives the response as if it were a standard OpenAI model.
Connecting via MCP
Cline also supports MCP. Add the ModelWorks xMCP server to Cline's MCP settings (.cline/mcp_settings.json):
{
"mcpServers": {
"modelworks": {
"url": "https://modelworks.ai/.well-known/x.mcp",
"headers": {
"Authorization": "Bearer mw_YOUR_API_KEY"
}
}
}
}Troubleshooting
| Issue | Fix |
|---|---|
| 401 Unauthorized | Your API key expired. Generate a new one from Settings. |
| 402 Payment Required | Fund your wallet at modelworks.ai/settings/wallet. |
| Empty response | Verify the circuit version is RUNNING (not STAGING). |