Back to Home
Pointing Cursor, Cline, and Continue at an OpenAI-Compatible Gateway
Integration guides8 min readSource: Admesh Engineering

Pointing Cursor, Cline, and Continue at an OpenAI-Compatible Gateway

Configure Cursor, Cline, and Continue against one OpenAI-compatible gateway: base URL, keys, model IDs, tool calling, context limits, and team policy.

What 'OpenAI-compatible' actually covers

The label describes the shape of the HTTP API, not a guarantee of identical behavior. In practice it means the client sends chat completions to a base URL with a bearer token and expects a response with choices, message content, and optional tool calls. Cursor, Cline, and Continue all implement that client side, which is why each of them offers an override for the base URL and key.

What the label does not cover is everything above the wire format: which model IDs exist, how many tokens the model can hold, whether the provider emits incremental deltas or one blob, and how strictly tool-call arguments are validated. Those are the details that decide whether an editor feels native or broken. Treat compatibility as a starting point to verify, not a property you can assume.

Configuring base URL, key, and model

  • If the tool has separate fields for OpenAI and OpenAI-compatible, use the compatible one; the first-party path sometimes hardcodes vendor endpoints.
  • Some editors cache the model list at startup. Restart after changing the base URL or the model dropdown may still show the old catalog.
  • Anthropic-shaped clients need the messages endpoint instead; mixing the two paths produces 404s that look like auth errors.
  1. Open the provider settings in the tool and choose the OpenAI-compatible or custom OpenAI option rather than the first-party OpenAI entry.
  2. Set the base URL to the gateway root that ends in /v1, for example https://api.admesh.ai/v1. Do not append /chat/completions; the client adds the path itself.
  3. Paste the gateway API key. Keep it in the tool's secret store or an environment variable, not in a committed settings file.
  4. Enter a model ID exactly as the catalog lists it. Copy it rather than retyping; capitalization and separators matter.
  5. Send a single trivial prompt before enabling the tool in agent mode, so a bad key or URL surfaces without side effects.

Where tool calling breaks

Agentic editing depends on the model returning well-formed tool calls: a function name plus JSON arguments. Gateways and providers differ in how they represent these. Some return arguments as a JSON string, some as an object, and some stream partial argument fragments that must be concatenated before parsing. A client that assumes one shape will either drop the call or throw a parse error mid-edit, which in an agent loop can mean a half-applied patch.

The second failure mode is the model that answers in prose instead of calling a tool. It looks like the assistant is ignoring instructions, but the real cause is often that the model was never trained for that tool schema or that the request omitted the tools array because the client only sends it for known model names. When you switch model IDs behind a gateway, re-test one file-edit and one shell-command task before trusting the setup for real work.

Context limits and streaming

Coding tools stuff a lot into the prompt: open files, retrieved snippets, terminal output, and conversation history. If the client believes the model has a larger window than it does, requests fail with a context-length error that the editor may report as a generic network problem. The reverse is also costly, since a client that assumes a small window truncates context the model could have used. Check the live catalog for the actual limit of each model ID rather than inferring it from the model family name.

Streaming is the quieter issue. Editors render tokens as they arrive, and some also rely on streamed tool-call deltas to start work early. If a provider buffers the whole response, the UI appears frozen for the duration and users assume a hang. If it streams malformed deltas, the editor may show duplicated text. Test with a long generation and watch whether output appears progressively.

A team-wide configuration policy

The payoff of a gateway is that this policy lives in one place. Adding a new model family or retiring an old one becomes a catalog change on the gateway side, not a migration across three editors and every developer laptop. The cost is a new single point of failure and a shared blast radius: a misconfigured key or a bad default model affects everyone at once, so keep a documented fallback and a way to roll back the default quickly.

  • Publish one internal snippet with the base URL, the key rotation process, and a short approved model list mapped to task types.
  • Pin model IDs in shared config rather than letting each developer pick from the dropdown; drift makes bug reports incomparable.
  • Route cheap, high-volume tasks such as autocomplete and commit messages to a smaller model and reserve stronger models for multi-file refactors.
  • Log which model served each request at the gateway so a bad output can be traced to a model rather than blamed on the editor.
  • Re-run a small smoke test after any model ID or gateway change: one completion, one tool call, one long streamed answer.

How to apply this with Admesh

Because one balance spans several model families, you can assign a fast, inexpensive model to autocomplete in Continue and a stronger one to agentic edits in Cline without opening separate accounts or reconciling separate invoices. That is the practical argument for a gateway in a coding-tool setup: the editor configuration stops encoding a vendor choice.

  1. Create a key in the Admesh console at https://console.admesh.ai and note that the same key and balance cover OpenAI, Anthropic, Google, DeepSeek, Qwen, Moonshot, Zhipu, and MiniMax families.
  2. In Cursor, Cline, and Continue, set the OpenAI-compatible base URL to https://api.admesh.ai/v1 and paste that key. For clients that speak the Anthropic message format, use https://api.admesh.ai/v1/messages instead.
  3. Choose model IDs from the live catalog at https://admesh.ai/models, and check https://admesh.ai/pricing before assigning models to high-volume tasks. Do not hardcode limits from memory; read them from the catalog.
  4. Keep the integration notes in https://docs.admesh.ai as the reference for endpoint behavior, and standardize the same base URL and key across the team so switching models is a config edit rather than a vendor migration.

When not to route through a gateway

If your team uses exactly one model from one vendor and has no plans to change, a direct connection removes a hop and one more thing to debug. Gateways earn their place when you want model choice per task, centralized keys, or a single bill. They also add a dependency: when the gateway is down, every editor is down, so keep a documented direct-endpoint fallback for emergencies.

Admesh API docs →

FAQ

Do I need different keys for Cursor, Cline, and Continue?
Not if all three point at the same gateway. One key works across them, though you may still want separate keys per tool or per developer so a leaked key can be revoked without disrupting everyone.
Why does my editor say the model does not exist?
Almost always a model ID mismatch. The ID must match the gateway catalog exactly, and some editors cache the list at startup, so restart after changing the base URL or the ID.
How do I know which context window to expect?
Read it from the live model catalog rather than assuming from the family name. Limits differ between models even within one provider, and the client's assumption is what triggers truncation or context-length errors.
Should I use the OpenAI or Anthropic endpoint?
Match the endpoint to the client's request format. OpenAI-shaped clients use the /v1 base URL; clients that send Anthropic-style messages use the messages endpoint. Pointing a client at the wrong shape produces errors that look like authentication failures.

References

Call these models through one gateway

Admesh provides a unified OpenAI-compatible API: one Base URL and one key for Claude, GPT, DeepSeek and more. New accounts get trial credit that never expires.