Cline Integration with The Grid | OpenAI API Setup
Connect Cline to The Grid with the OpenAI-compatible API. Set the base URL, add your consumption key, choose an instrument, and start coding.
Cline treats The Grid as an ordinary OpenAI-compatible provider. No plugin, no proxy. Three fields in the settings panel and the agent runs on market-priced inference.
Prerequisites
Cline installed in VS Code from the VS Code Marketplace. Cursor users can install the same extension from Cursor's extension panel.
A Grid account at app.thegrid.ai.
Credits in your account. The Grid is prepaid; zero credits returns 402.
A Grid consumption API key from Settings → API Keys → Create Consumption Key. Trading keys are rejected by the inference API.
Setup
1. Open the Cline settings panel
In VS Code or Cursor, click the gear icon in the Cline sidebar. Under API Configuration, open the API Provider dropdown and select OpenAI Compatible.
2. Fill in the three fields
Base URL
https://api.thegrid.ai/v1
OpenAI Compatible API Key
your Grid consumption key
Model ID
an instrument name, e.g. agent-prime
The Model ID field is free text. Type the instrument name exactly as published in the current instruments list. A typo surfaces as 404 on the first message.
3. Pick an instrument for your workload
Cline runs an agent loop (file reads, edits, terminal, MCP tools), which rewards Agent and Code instruments. Start with agent-prime for general work, code-prime if you mostly write code, and reach for the Max tier on Plan mode or genuinely hard tasks. Full tier guidance lives in the current instruments list.
4. (Optional) Split Plan and Act
Enable Use different models for Plan and Act modes in Cline settings to route Plan mode to a stronger instrument. A common pattern: agent-max for Plan, agent-prime for Act.
5. Set the context window and max output
Under Model Configuration in the Cline settings, set the context window and max output tokens for the instrument you picked. Cline computes how much it can send as roughly min(max output, context window − buffer), so if these are left at a default that's larger than the instrument's real window, a long task overruns it and returns a 400. For the instruments above, set the context window to 196,608 on agent-prime and 1M on agent-max, and keep max output below it (32K is a safe default). If you pick a different instrument, get its context window from the current instruments list.
6. (Optional) Tune reasoning effort
If the Reasoning Effort selector appears for your chosen instrument, medium is a good default for agent loops. Raise to high for hard reasoning, drop to low for cheap high-volume execution.
Verification
Open a new Cline task and ask it to do something concrete: "Create a health check endpoint in Express at /health and add a test." If Cline reads the workspace, writes the file, and finishes without 401 or 402, the integration is live.
Troubleshooting
Last updated
Was this helpful?