Configuring Cursor and Cline to work with a relay service
What makes editor tools different
Tools like Cursor, Cline, Continue and Roo Code are not used the way Claude Code is, and that produces two special requirements:
One: the requests are small and constant. Every few keystrokes, every file save, can trigger a request. That can add up to several hundred or a thousand calls a day.
Two: they are extremely sensitive to time-to-first-token. A command-line tool can afford to be slow; a completion that lags half a second in the editor breaks your flow.
Together these decide one thing: when you pick a service for editor work, latency matters more than the rate multiplier.
What to configure
1. base_url and protocol
Most editor tools speak the OpenAI-compatible protocol, which keeps configuration simple:
Base URL: https://service-domain/v1
API Key: your key
Model: the model id the service offers
Watch whether base_url should end in /v1 — tools handle it differently, and getting it wrong means a 404. Trying both once is the fastest way to find out.
2. Model choice
For editor work, pick a model that is fast and cheap rather than the strongest one:
- Completion, renaming, small refactors → a lightweight model is enough
- Complex refactors, architecture work → switch to a strong model by hand
Running every completion through the strongest model is absurdly expensive, and slow.
3. Turn off automatic requests you do not need
Many editor tools enable completion-as-you-type by default. That is a plus for focus and a minus for cost.
Suggested:
- Keep inline completion (it is the core of the experience)
- Turn off high-frequency whole-file analysis
- Trigger it manually when you need it
Three common traps
Trap 1: hitting the concurrency limit
Editor tools can fire several requests in a burst (completion + background analysis + indexing). If your service caps concurrency low, you get scattered failures.
Symptom: most requests are fine, one or two error out. Because it does not break the main flow it is easy to ignore — but you are quietly losing requests the whole time.
Fix: cap concurrency in the tool's settings, or move to a service with more headroom.
Trap 2: silently truncated context
Editor tools send a whole file, or a whole project slice, as context. If the service limits input length, the excess may be silently truncated rather than returned as an error.
Symptom: completions on small files are fine; on large files the output is obviously wrong, because the model only ever saw part of the file.
How to test: take a large file and put something near the end that can only be completed correctly if the whole file was read.
Trap 3: caching that does not apply, and the bill that follows
Editor work repeats context heavily (the same file, over and over), so caching should save a great deal. If the service does not support caching, you pay for the full file on every resend.
The arithmetic: a 2,000-line file is roughly 30k tokens. Billed per call, 200 completions a day is 6 million tokens. With caching and without it, that is several times the cost.
Configuration checklist
[ ] Tried base_url both with and without /v1, and know which one works
[ ] Model name matches what /v1/models returns
[ ] Tested with a large file, confirmed context is not truncated
[ ] Turned off unnecessary high-frequency automatic requests
[ ] Watched time-to-first-token, confirmed streaming works
[ ] After a day of use, checked billing to confirm caching applies
[ ] Confirmed the concurrency cap is enough
One recommendation
For editor work, use a service of its own — do not share it with production traffic.
The reason: editor traffic is heavy and bursty, and can trip risk controls that then affect your production work; in the other direction, production spikes will degrade your completions. Manage them separately and tune each on its own.
Related reading
- Choosing a provider for code completion: why latency beats rate
- Does prompt caching actually work on a relay service?
- How to give a project several API providers as failover
Was this useful? If you have run into something the article does not cover, tell us and we will verify it and update the text.
Related articles
Video generation behind a relay: three API shapes, four billing traps, one acceptance checklist
MCP through a relay: what works, what never will, and how to test it in ten minutes
A relay selection decision tree: working back from your scenario to a site
Logging and reconciliation: attributing token spend to the project level
Migrating suppliers gradually: replacing an API site without interrupting service
Build your own probe: twenty lines of script to monitor your API suppliers
Read on: a few of the services we list
This article does not point at a specific model family, so here are a few of the highest-scoring services we list, in case you want to read on. They are ordered by score and uptime and are not a recommendation.
See the full list in the directory, or browse by model family.