Hi everyone, I'm having trouble getting Kilo Code to work with OmniRoute, and I've been unable to identify the cause despite trying several things.
My setup:
- OS: Ubuntu 26.04.1 LTS
- Node.js: v24.21.0
- OmniRoute: 3.8.52 (initially 3.8.54)
- Kilo Code: VS Code extension
- OmniRoute local dashboard: "http://localhost:20128"
- Provider: Cloudflare Workers AI
- Model: "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
The issue:
Whenever I send a prompt through Kilo Code using my OmniRoute model configuration, I get this error:
"Your authentication token is invalid. Please sign in again."
Previously, the detailed error response showed:
- Status code: 401
- Error code: "INVALID_TOKEN"
- Error type: "authentication_required"
- Endpoint shown in the response: "https://ai-gateway.kilo.ai/api/v1/chat/completions"
the details section drop-down:
{
"name": "APIError",
"data": {
"message": "Your authentication token is invalid. Please sign in again.",
"statusCode": 401,
"isRetryable": false,
"responseHeaders": {
"cache-control": "public, max-age=0, must-revalidate",
"content-type": "application/json",
"date": "Tue, 01 Dec 2026 03:48:49 GMT",
"referrer-policy": "no-referrer",
"server": "Vercel",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"transfer-encoding": "chunked",
"www-authenticate": "Bearer error=\"invalid_token\"",
"x-content-type-options": "nosniff",
"x-matched-path": "/api/v1/[...path]",
"x-vercel-cache": "MISS",
"x-vercel-id": "bom1::fra1::nksgm-1796096929622-4fc04b074581"
},
"responseBody": "{\"error\":{\"code\":\"INVALID_TOKEN\",\"message\":\"Your authentication token is invalid. Please sign in again.\"},\"error_type\":\"authentication_required\"}",
"metadata": {
"url": "https://ai-gateway.kilo.ai/api/v1/chat/completions"
}
}
}
What I've tried so far:
Initially, Kilo Code returned an authentication error.
I changed the model/provider configuration to use OmniRoute.
After that, I encountered a Cloudflare Workers AI error saying that an Account ID was required.
I added my Cloudflare Account ID in OmniRoute's provider settings.
The missing Account ID warning disappeared, but testing the Cloudflare provider returned an upstream 401 error. The dashboard also showed a Cloudflare analytics API 400 error.
I suspected the problem might have been caused by a recent OmniRoute update, so I rolled back from 3.8.54 to 3.8.52.
Before downgrading, I created a backup of my entire "~/.omniroute" directory. I also found that the updater's backup contained an "omniroute.mjs" file identical to the 3.8.52 package.
The downgrade completed successfully, the post-install script ran, and the dashboard opens normally. However, Kilo Code still returns the same authentication error.
What I'm trying to understand:
- Is Kilo Code actually sending requests to my local OmniRoute server, or is it still using Kilo's own API gateway?
- Could this be an incorrect API provider, Base URL, or authentication configuration in Kilo Code?
- Is there anything specific I need to configure in OmniRoute for Kilo Code to authenticate correctly?
- Could the Cloudflare upstream 401 and the Kilo Code INVALID_TOKEN errors be separate problems?
I'd appreciate any help identifying where the authentication is failing. I've attached screenshots of my configuration and the errors.
Thanks!