Claude and GPT in Cursor and Cline, Paid Per Token

Use Claude Opus 5.5, Sonnet 5.5 and GPT-6 in Cursor and Cline with one prepaid key. Setup, which model for which task, and keeping agent costs under control.

3 min read

claudegptcodingcursorcline

Two glowing orbs of different colours hovering over a code editor like assistants

Coding agents do their best work on the strongest models, and the strongest models are the ones you most want to pay for by use rather than by seat. With one API Store key, Cursor and Cline can use Claude, GPT, Gemini and DeepSeek, paid per token from a prepaid balance. This post shows the setup and how to keep a day of agent work at a price you expect.

Setup

Both tools take an OpenAI-compatible base URL, and both use the same three values:

text
Base URL:  https://api.apistore.cloud/v1
API key:   sk-...   (from the API keys page)
Model:     claude-sonnet-5-5
  • Cline (VS Code): choose the "OpenAI Compatible" provider and enter the three values. Step-by-step guide.
  • Cursor: in Settings, Models, turn on the OpenAI base URL override, paste the key and base URL, and add the model name as a custom model. Step-by-step guide.

The guides use a DeepSeek model as the example. The steps are the same for Claude and GPT: only the model name changes. You can add several model names and switch between them in the tool.

Claude Code is different: it talks to Anthropic's own API. It can still use API Store's models and tools through the MCP server. See the Claude Code guide.

Which model for which task

TaskGood first choice
Large changes across many files, long agent runsclaude-opus-5-5 or gpt-6.2-sol
Everyday edits, tests, explanationsclaude-sonnet-5-5 or gpt-6.1-terra
Quick questions, commit messages, small fixesclaude-haiku-5-5 or deepseek-v4-1-flash
Reading a very large codebase in one gogemini-4-hydrogen (1M-token context)

Pick one model as your default and switch up only when it gets stuck. Most of a day's edits don't need the most expensive model.

How agents spend tokens

Each step an agent takes sends the system prompt, the tool definitions, the files it has read and the conversation so far. A task of twenty steps sends most of that twenty times. So:

  • Input is most of the bill. An agent reads far more than it writes.
  • The cache does the heavy lifting. The part of each request that repeats is billed at the cached price, which is a tenth or less of the input price on these models: for Claude Sonnet 5.5, $0.07 per million tokens against $1.4.
  • Long prompts can cost more. GPT models bill a whole request at their long-prompt prices once the prompt passes 272,000 tokens, and Claude Haiku 5.5 does the same above 100,000. If an agent's context grows that large, start a new task.

Four habits that keep the bill predictable

  1. One key per tool, with a daily cap. Create a key for Cursor and another for Cline, and set a daily spending cap on each on the API keys page. If an agent loops, it stops at the cap with 402 key_spend_cap.
  2. Start new tasks often. A fresh task carries less history, so each step reads fewer tokens.
  3. Use thinking where it pays. If your tool lets you set reasoning effort, keep it low for simple edits. Thinking tokens are billed as output, the dearest part of the price.
  4. Check the first day. The Usage page shows each request's model, tokens and cost. After a day of normal work you'll know what your agent costs, and can set the caps from real numbers.

Troubleshooting

  • 401 invalid_api_key: the key was mistyped or revoked. Create a new one.
  • 404 model_not_found: check the model name. Claude names use dashes (claude-sonnet-5-5), GPT and Gemini names use dots (gpt-6.1-terra).
  • 429 rate_limit_exceeded: the agent is sending faster than the key's limit. Cline retries by itself.
  • Cursor's own models stop working: the base URL override applies to all of Cursor's OpenAI models. Turn it off to go back.

For DeepSeek in the same tools, see DeepSeek for coding agents.

Also in Tiếng Việt, Español, Português, Bahasa Indonesia