Skip to main content

IDE assistants

Cline, Continue and Roo Code are AI coding assistants that run inside VS Code, and Zed and JetBrains AI Assistant are assistants built into their editors. All five can call any endpoint that speaks the OpenAI format, and Zed can also speak the Anthropic format, so each one connects to the gateway with three values: the gateway's address, a virtual key and a public model name. Routing them through Spanway means engineers can pick any assistant they like while the company still decides which models they use, every request shows on the gateway's Logs page under the engineer's key, the key's budget stops a runaway agent loop, and routing, fallbacks and guardrails apply to all of them alike.

This page has one section per tool under Steps, and the key, the checks, the errors and the troubleshooting are shared. Cursor and GitHub Copilot have their own pages, Cursor and VS Code with GitHub Copilot.

A real-world scenario​

A team of eight uses three editors. Five engineers use VS Code with Cline or Roo Code, two use JetBrains IDEs and one uses Zed. The admin gives each engineer a key with the same two chat models, a 100 USD monthly budget and a tag for their tool. Each engineer follows the section for their tool on this page, runs the curl check once, and sends a prompt. The admin opens Usage, groups by tag, and sees the spend per tool, and when the JetBrains users want a small model for commit messages, the admin adds it to their keys.

Before you start​

  • A gateway address the editor can reach. All five tools call the gateway from your own computer, so a private or localhost address works.
  • One or more chat models on the gateway. Agent features in Cline, Roo Code, Continue and Zed need a model with tool calling. Roo Code only works with models that support tool calling.
  • The model names and limits the key may use, from GET /model_group/info with the key. Most of these tools ask you to type the model name and its context size, and this answer has them.

Make a key for the tool​

The full recipe is make a key for a tool.

  1. Open Virtual Keys (/ui/api-keys) and click + Create New Key.
  2. Pick the engineer under Key Ownership, set Key Name to a name such as jane-cline and leave Key Type on AI APIs.
  3. In Models, pick the chat model the engineer uses, and the extra models the tool calls in the background. Continue sends autocomplete to its own model, JetBrains sends Instant helpers tasks such as chat titles and name suggestions to a second model, and Roo Code can use a different model per mode. A background model missing from the key fails with 403 while the main chat works.
  4. Under Optional Settings, set Max Budget (USD) and Reset Budget, for example 100 and monthly. Set Requests per minute Limit (RPM) high enough for the tool, because autocomplete and agent loops send many requests a minute. Add the Tags code-context and a tool tag such as tool:cline.
  5. Click Create Key and copy the key. It is shown once.
curl -X POST https://gateway.example.com/key/generate \
-H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" \
-d '{"key_alias": "jane-cline", "key_type": "llm_api", "models": ["claude-sonnet-5-5", "gpt-6.1-sol"], "max_budget": 100, "budget_duration": "30d", "rpm_limit": 120, "tags": ["code-context", "tool:cline"]}'

Key tags need an Enterprise license. Without one the gateway does not create the key and answers Only premium users can add tags to keys, so leave Tags empty and drop tags from the call. The tool then works the same, only data policy routing cannot match the code-context tag.

The code-context tag lets data policy routing treat the key's traffic as code, because none of these tools sends a signal of its own.

Steps​

Check the key and read the model names and limits first. The same check works for every tool on this page.

curl https://gateway.example.com/model_group/info -H "Authorization: Bearer $SPANWAY_API_KEY"

Each entry has model_group (the model name to type in the tool), max_input_tokens (the context window), max_output_tokens, supports_function_calling, supports_vision, and input_cost_per_token and output_cost_per_token (multiply by 1,000,000 for the price per million tokens that Cline and Roo Code ask for).

The base URL for the OpenAI format is https://gateway.example.com/v1. The gateway also answers the OpenAI routes without /v1, so if a tool adds /v1 itself and reports 404, the bare https://gateway.example.com works. See the /v1 rule.

Cline​

  1. Open the Cline panel in VS Code and click the settings gear.
  2. Set API Provider to OpenAI Compatible.
  3. Set Base URL to https://gateway.example.com/v1.
  4. Paste the virtual key into API Key. Leave Use Azure Identity Authentication off.
  5. Type the gateway model name into Model, for example claude-sonnet-5-5.
  6. Open Model Configuration and copy the values from /model_group/info: Max Output Tokens from max_output_tokens, Context Window from max_input_tokens, Image Support from supports_vision, Computer Use only when supports_function_calling is true, and Input Price and Output Price per million tokens. Cline uses these to size prompts and to show cost, so wrong values give cut-off context or a cost display that disagrees with the gateway's spend.
  7. Start a task. Cline sends the key as Authorization: Bearer <key>.

Roo Code​

  1. Open the Roo Code panel in VS Code and open its settings.
  2. Set API Provider to OpenAI Compatible.
  3. Set Base URL to https://gateway.example.com/v1 and paste the key into API Key.
  4. Set Model to the gateway model name. Pick a model whose supports_function_calling is true, because Roo Code uses tool calling for everything and has no fallback without it.
  5. Under Model Configuration, fill in Max Output Tokens, Context Window, Image Support, Computer Use, Input Price and Output Price the same way as for Cline.
  6. Save and start a task. To use a different model per mode, create one settings profile per model with the same base URL and key, and make sure the key allows every model.

Continue​

Continue reads its configuration from ~/.continue/config.yaml (%USERPROFILE%\.continue\config.yaml on Windows), and the key from a secret, so it never sits in the file.

  1. Put the key in ~/.continue/.env as SPANWAY_API_KEY=sk-.... Continue also reads a .env at the workspace root and the process environment.

  2. Add the models to config.yaml. provider: openai with an apiBase is how Continue talks to any OpenAI compatible endpoint.

    name: Spanway
    version: 0.0.1
    schema: v1
    models:
    - name: Claude Sonnet 5.5 (Spanway)
    provider: openai
    model: claude-sonnet-5-5
    apiBase: https://gateway.example.com/v1
    apiKey: ${{ secrets.SPANWAY_API_KEY }}
    roles: [chat, edit, apply]
    capabilities: [tool_use, image_input]
    requestOptions:
    headers:
    x-spanway-code-context: "true"
    - name: Autocomplete (Spanway)
    provider: openai
    model: code-complete
    apiBase: https://gateway.example.com/v1
    apiKey: ${{ secrets.SPANWAY_API_KEY }}
    roles: [autocomplete]
  3. Replace code-complete with the gateway name of a fast, cheap model the admin published for completion. Autocomplete sends a request on almost every pause in typing, so keep it off your most expensive model.

  4. Reload the Continue panel and pick Claude Sonnet 5.5 (Spanway) in its model picker.

capabilities: [tool_use] is needed for agent mode, and image_input only when the model supports images. If the gateway's certificate is signed by a company authority, add caBundlePath: /path/to/company-root.pem under requestOptions.

Zed​

Zed has its own settings for any OpenAI compatible or Anthropic compatible endpoint. The key goes in an environment variable or in Zed's settings screen, never in settings.json.

  1. Run zed: open settings and add a provider under language_models. Use openai_compatible with /v1 in the URL for any gateway model, or anthropic_compatible without /v1 for Claude models, because Zed adds /v1/messages itself.

    {
    "language_models": {
    "openai_compatible": {
    "Spanway": {
    "api_url": "https://gateway.example.com/v1",
    "available_models": [
    {
    "name": "gpt-6.1-sol",
    "display_name": "GPT 6.1 Sol (Spanway)",
    "max_tokens": 922000,
    "max_output_tokens": 128000,
    "capabilities": {"tools": true, "images": true, "parallel_tool_calls": true, "prompt_cache_key": false}
    }
    ]
    }
    },
    "anthropic_compatible": {
    "Spanway Claude": {
    "api_url": "https://gateway.example.com",
    "available_models": [
    {
    "name": "claude-sonnet-5-5",
    "display_name": "Claude Sonnet 5.5 (Spanway)",
    "max_tokens": 1000000,
    "max_output_tokens": 128000,
    "capabilities": {"tools": true, "images": true, "prompt_caching": true}
    }
    ]
    }
    }
    }
    }
  2. Give Zed the key. Zed builds the variable name from the provider name in upper snake case plus _API_KEY, so the providers above read SPANWAY_API_KEY and SPANWAY_CLAUDE_API_KEY. Set them in the environment Zed starts from, or run agent: open settings and enter the key for the provider under LLM Providers, which stores it in the system keychain.

  3. Open the Agent Panel and pick the model under the provider name.

Zed does not read the model list from the gateway, so every model has to be listed in available_models, with name set to the gateway model name, max_tokens to max_input_tokens and max_output_tokens to max_output_tokens from GET /model_group/info with your key. The numbers above are what the gateway's model map gives these two models, so replace them with your gateway's answer when its deployments differ. prompt_cache_key is off by default for OpenAI compatible models in Zed. Turn it on only when the model behind the name is an OpenAI model, because a provider that does not take that parameter answers 400. Zed sends the key as Authorization: Bearer <key> to OpenAI compatible providers and as x-api-key to Anthropic compatible ones, and the gateway accepts both. A custom_headers object on the provider adds headers to every request, for example {"x-spanway-code-context": "true"}.

JetBrains AI Assistant​

  1. Open Settings, Tools, AI Assistant, Providers & API keys.
  2. Under Third-party AI providers, pick OpenAI-compatible.
  3. Set URL to https://gateway.example.com/v1 and paste the key into API Key.
  4. Turn on Tool calling if the model supports tool calls, so AI Assistant can use MCP tools with it.
  5. Click Test Connection, then Apply. If the test reports 404, set URL to https://gateway.example.com and test again, as explained above.
  6. Under Models Assignment, pick a gateway model for Core features and a small, cheap one for Instant helpers, and set Context window from max_input_tokens. Until you assign them, gateway models are only offered in AI Chat, in their own section of the model picker.
  7. Optional, for code completion: in the AI Completion section pick OpenAI Compatible and fill in API key, Base URL, Model, Model context, Max output tokens and Prompt schema. Use a model made for code completion, because general chat models are usually poor at it. Test Connection here checks the address and the key, not the model name.

JetBrains AI Assistant only speaks the OpenAI format, so Claude models reach it through the gateway's OpenAI compatible routes, which translate the request. The key is sent as Authorization: Bearer <key>. JetBrains AI Assistant also needs its own subscription for the features that use JetBrains' models, and an IDE managed by your company's JetBrains administrator can have third-party providers turned off.

Expected result​

The tool lists the gateway model, answers stream into its chat panel, and agent tasks call tools. The check at the start of Steps answers 200 with one entry per model the key may use.

On the gateway, open Logs (/ui/logs), click Filters, pick the key under Key Alias and click Apply Filters. Each chat turn, agent step and autocomplete request is a row with the model, the tokens and the cost. Usage groups the spend by key and, with the tool tag, by tool. Tools whose User-Agent names them, such as Cline, can also appear under Top agents on Usage, while tools that call through a general HTTP library show under that library.

None of these tools shows response headers, so send the same request with curl and -i to read them.

curl -i https://gateway.example.com/v1/chat/completions \
-H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "claude-sonnet-5-5", "messages": [{"role": "user", "content": "Say hello"}]}'

Look at x-spanway-call-id (the id to search for on Logs), x-spanway-model-group and x-spanway-model-id (the name and the deployment that answered), x-spanway-response-cost, x-spanway-key-spend and x-spanway-key-max-budget.

What works and what does not​

FeatureCline and Roo CodeContinueZedJetBrains AI Assistant
StreamingYesYesYesYes
Tool calls and agent modeYes, needs a model with tool callingYes, with capabilities: [tool_use]Yes, with "tools": trueYes, with Tool calling on
ImagesWith Image Support onWith image_inputWith "images": trueNot covered by JetBrains' setup
Prompt cachingAs the provider behind the name doesAs the provider behind the name doesNative on anthropic_compatible with prompt_cachingAs the provider behind the name does
AutocompleteNoYes, the autocomplete roleNo, Zed's edit predictions are separateYes, the AI Completion section
Model list from the gatewayNo, type the nameNo, list each modelNo, list each modelYes, models the key may use

Every tool on this page sends requests in the OpenAI or Anthropic format, and the gateway translates them for the provider behind the name. A setting that one provider does not take, such as a reasoning or cache parameter, can fail with 400, see Errors. The admin can set drop_params: true on the deployment so the gateway removes such settings, see drop params.

Errors​

Cline and Roo Code show the status followed by the gateway's message, for example 401 Authentication Error, Invalid proxy server token passed. Continue shows the HTTP status and the address it called, followed by the gateway's answer, which also shows a doubled /v1 at a glance. Zed shows the error in the Agent Panel, and JetBrains shows it on Test Connection or in AI Chat. In every tool the text comes from the gateway, and the same text is on the request's row on Logs. A request that never reached the gateway has no row on Logs.

Gateway messageStatusCauseFix
Authentication Error, Invalid proxy server token passed401The key is wrong, deleted or blocked.Paste the key again, or ask the admin for a new one.
Authentication Error, No api key passed in.401The tool sent no key. In Continue the secret name does not match the .env entry, in Zed the environment variable is not set where Zed starts.Fix the key setting for the tool, see Steps.
The requested model '<model>' is not available for this API key, or the model name is invalid.403The key may not use that model, often a background model such as Continue's autocomplete model or JetBrains' Instant helpers model.Ask the admin to add the model to the key, or pick one the key allows.
Invalid model name passed in model=<name>400No gateway model has that name. A typo, a different case, or the provider's own model id.Copy model_group from /model_group/info exactly.
does not support parameters: <names>, for model=<model>400The model behind the name does not take a setting the tool sent, such as prompt_cache_key when it is set to true in Zed, or a reasoning setting.Turn the setting off in the tool, or ask the admin for drop_params: true.
Budget has been exceeded! Key=<key alias> Current cost: <spend>, Max budget: <max>422The key's budget is used up.Wait for the reset, or ask the admin to raise Max Budget (USD).
Rate limit exceeded for <scope>: <value>. Limit type: <type>.429Too many requests or tokens per minute, common with autocomplete and agent loops.Wait a minute, or ask the admin to raise the key's RPM or TPM.
Not Found404The base URL has /v1 and the tool adds /v1 itself, or Zed's anthropic_compatible URL ends in /v1.Apply the /v1 rule.
None, ECONNREFUSED, Connection refused or a connection errornoneNothing listens at that address and port.Check curl https://gateway.example.com/health/liveliness.
None, getaddrinfo ENOTFOUNDnoneThe host name does not resolve on that machine.Check the spelling, the VPN and the internal DNS.
None, self signed certificate in certificate chain or unable to get local issuer certificatenoneThe gateway's certificate is signed by a company authority the tool does not trust.For Cline, Roo Code and Continue, add the company root certificate to the operating system's trust store, which VS Code passes to extensions while http.systemCertificates is on, or start VS Code with NODE_EXTRA_CA_CERTS set. Continue also takes requestOptions.caBundlePath. For JetBrains, add it under Settings, Tools, Server Certificates. For Zed, add it to the operating system's trust store and restart Zed.

The client error reference lists every gateway error with the exception each SDK raises.

Troubleshooting​

  1. Run the check at the start of Steps with the same key. If it answers 200, the key and the address are fine and the problem is in the tool's settings.
  2. Open Logs, filter by the Key Alias and the time of the failure. A row means the request reached the gateway, and the drawer shows the error, the model the router picked and the provider's answer. No row means the request never arrived, so check the base URL, the network and the certificate.
  3. Look at the tool's own log. Cline and Roo Code show every API request in the task, and the failed one carries the error. Continue and the other VS Code extensions write to their own channel in the VS Code Output panel. Zed opens its log with zed: open log. JetBrains IDEs open theirs with Help, Show Log in Finder on macOS or Show Log in Explorer on Windows.
  4. For a wrong answer rather than an error, send the request with curl and -i and read x-spanway-model-id and x-spanway-routing-reason to see which deployment answered and why.
  5. On a test gateway, start it with --detailed_debug to log every request it receives, with its route and the key check result.

More symptoms are in troubleshooting.

Rotate or remove the key​

To rotate, open the key in Virtual Keys, click Regenerate Key and set a Grace Period such as 24h, so the old key keeps working while you update the tool. Then put the new key in the same place as the old one: the API Key field in Cline, Roo Code and JetBrains, ~/.continue/.env for Continue, and the environment variable or LLM Providers entry in Zed, after which Zed needs a restart if it reads the variable. Regenerating needs an Enterprise license. Without one, create a new key, move the tool to it and delete the old key. To stop a tool at once, use Block Key in the key's actions menu.

To stop using the gateway, switch the tool back to another provider, delete the models from Continue's config.yaml or Zed's settings.json, and delete the key.