DEV Community

Cover image for Roo Code with DeepSeek V4 Flash over an OpenAI-compatible endpoint (plus a tool-call check first)
CloudGPU
CloudGPU

Posted on

Roo Code with DeepSeek V4 Flash over an OpenAI-compatible endpoint (plus a tool-call check first)

Adapted from our CloudGPU guide on using DeepSeek V4 Flash in Roo Code.

Short answer: in Roo Code, pick the OpenAI Compatible provider, set the Base URL to https://cloudgpu.app/v1, paste your API key and type the model ID deepseek-v4-flash. Before you start a real task, send one request with a tools array. Roo Code only works with models that return native tool calls, and that one request tells you whether yours does.

Disclosure: I work on CloudGPU, and the endpoint below is ours. The Roo Code steps follow the official Roo Code docs (Using OpenAI Compatible Providers). We haven't run Roo Code end to end against this endpoint ourselves, so treat the checks below as something you run, not results we measured.

Note: Tool calling through this endpoint isn't tested by us; run the self-check in Step 3 before relying on Roo Code's tools.

What you need

  • An API key (cgw-sk-...) from the API Console. It is shown once, so copy it right away. The quick start is on the API docs page.
  • Roo Code installed in VS Code (follow its install docs).
  • The key in an environment variable, so it stays out of your shell history and scripts:
export CGW_API_KEY="cgw-sk-your-key"
Enter fullscreen mode Exit fullscreen mode

Step 1: Configure the provider in Roo Code

From the Roo Code docs, the settings live in the Roo Code settings panel:

Roo Code field Value
API Provider OpenAI Compatible
Base URL https://cloudgpu.app/v1
API Key your cgw-sk-... key
Model deepseek-v4-flash

Model Configuration (Max Output Tokens, Context Window and so on) is optional. We don't publish values for these models here, so leave the defaults unless you know the limits you need.

Other chat model IDs on the API page model table (checked 2026-10-27) that go in the same Model field:

Model ID Model
deepseek-v4-flash DeepSeek V4 Flash
deepseek-v4.1-flash DeepSeek V4.1 Flash
kimi-k3 Kimi K3
kimi-k2.6 Kimi K2.6

IDs are case-sensitive. GET /v1/models (with your key) returns the exact list your key can use:

curl -s https://cloudgpu.app/v1/models \
  -H "Authorization: Bearer $CGW_API_KEY"
Enter fullscreen mode Exit fullscreen mode

Without the Authorization header you get 401 missing_authorization, which is a quick way to confirm the URL is right but the key isn't being sent.

Step 2: Plain chat check

This is the request from the API docs, with your model ID:

curl https://cloudgpu.app/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CGW_API_KEY" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Say hi in one sentence."}]}'
Enter fullscreen mode Exit fullscreen mode

If this fails, fix it before touching Roo Code. The troubleshooting list at the end maps the error codes.

Step 3: Native tool-call check (the one that matters for Roo Code)

The Roo Code docs say it "uses native tool calling exclusively" and "If a model does not support native tool calling, it cannot be used with Roo Code." So send one request with a tools array and look at what comes back:

curl https://cloudgpu.app/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CGW_API_KEY" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{"role": "user", "content": "What is the weather in Paris? Use the tool."}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get the weather for a city",
        "parameters": {
          "type": "object",
          "properties": {"city": {"type": "string"}},
          "required": ["city"]
        }
      }
    }]
  }'
Enter fullscreen mode Exit fullscreen mode

The same check with the openai Python package (pip install openai), looping over the four model IDs from the table above. Check GET /v1/models for the current list.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://cloudgpu.app/v1",
    api_key=os.environ["CGW_API_KEY"],
)

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Get the weather for a city",
        "parameters": {
            "type": "object",
            "properties": {"city": {"type": "string"}},
            "required": ["city"],
        },
    },
}]

for model in ["deepseek-v4-flash", "deepseek-v4.1-flash", "kimi-k3", "kimi-k2.6"]:
    try:
        resp = client.chat.completions.create(
            model=model,
            messages=[{"role": "user", "content": "What is the weather in Paris? Use the tool."}],
            tools=tools,
            max_tokens=2048,  # leave room: some models think before they answer
        )
    except Exception as e:
        print(f"{model}: error -> {e}")
        continue
    msg = resp.choices[0].message
    if msg.tool_calls:
        call = msg.tool_calls[0].function
        print(f"{model}: tool call -> {call.name}({call.arguments})")
    else:
        print(f"{model}: no tool call, text -> {msg.content!r}")
Enter fullscreen mode Exit fullscreen mode

How to read it:

  • tool_calls present (a get_weather call with {"city": "Paris"} or similar): the model returned a tool call for this request; try it in Roo Code on a small task before you rely on it.
  • Plain text or an error: Roo Code is unlikely to work with that model. Try another ID from /v1/models.
  • Empty content and no tool call: some models spend output tokens on thinking first. Raise max_tokens (and Max Output Tokens in Roo Code's Model Configuration) and run it again before you decide.

Troubleshooting

These match the Roo Code docs' troubleshooting list and the error codes on the API docs page:

  • "Invalid API Key" (HTTP 401 invalid_api_key): the key is wrong or revoked. Create a new one in the console (keys are shown once).
  • HTTP 401 missing_authorization: no Authorization: Bearer header was sent. In a shell, check echo $CGW_API_KEY isn't empty.
  • "Model Not Found" (HTTP 400 model_not_found): check the ID against /v1/models; IDs are case-sensitive.
  • Connection errors: the Base URL must be exactly https://cloudgpu.app/v1.
  • Tool-calling errors: Roo Code needs native tool calling. Re-run the Step 3 check; if it fails, try another ID and run the check again.
  • HTTP 429 rate_limit_exceeded: the API docs list 100 requests per minute per key and 10,000 requests per day per account during the beta.

FAQ

Does Roo Code work with an OpenAI-compatible API?
Yes. The Roo Code docs describe connecting to any OpenAI-compatible endpoint with a base URL, an API key and a model ID.

Does deepseek-v4-flash support the tool calling Roo Code needs?
We haven't confirmed it inside Roo Code. Run the Step 3 check before you rely on it.

Can I switch to Kimi without changing anything else?
Yes, change only the Model field to kimi-k3 or kimi-k2.6. Run the tool-call check for that ID first.

Where are the rates?
Per-model rates are in the price table on the CloudGPU API page.


Facts checked 2026-10-27.

Top comments (0)