Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
fix(auth): return synthetic credentials for noAuth free providers
diegosouzapw7fdcba9e0522
diff --git a/src/app/(dashboard)/dashboard/providers/[id]/page.tsx b/src/app/(dashboard)/dashboard/providers/[id]/page.tsxindex cac8ba720c..8298004691 100644--- a/src/app/(dashboard)/dashboard/providers/[id]/page.tsx+++ b/src/app/(dashboard)/dashboard/providers/[id]/page.tsx@@ -2542,7 +2542,7 @@ export default function ProviderDetailPage() {}};- const canImportModels = connections.some((conn) => conn.isActive !== false);+ const canImportModels = isFreeNoAuth || connections.some((conn) => conn.isActive !== false);// Auto-sync toggle state: read from first active connection's providerSpecificDataconst autoSyncConnection = connections.find((conn: any) => conn.isActive !== false);diff --git a/src/sse/services/auth.ts b/src/sse/services/auth.tsindex 210fb66a4e..2410e9edfa 100644--- a/src/sse/services/auth.ts+++ b/src/sse/services/auth.ts@@ -37,7 +37,7 @@ import {PROVIDER_ERROR_TYPES,} from "@omniroute/open-sse/services/errorClassifier.ts";import { getCodexModelScope } from "@omniroute/open-sse/executors/codex.ts";-import { getProviderAlias, resolveProviderId } from "@/shared/constants/providers";+import { getProviderAlias, resolveProviderId, FREE_PROVIDERS } from "@/shared/constants/providers";import { isModelExcludedByConnection } from "@/domain/connectionModelRules";import * as log from "../utils/logger";import { fisherYatesShuffle, getNextFromDeckSync } from "@/shared/utils/shuffleDeck";@@ -770,6 +770,29 @@ export async function getProviderCredentials(try {await currentMutex;+ // noAuth free providers (e.g. opencode) need no DB connection — return synthetic credentials+ // so the executor receives a valid credentials object without auth headers being added.+ const resolvedId = resolveProviderId(provider);+ if (FREE_PROVIDERS[resolvedId]?.noAuth) {+ return {+ apiKey: null,+ accessToken: null,+ refreshToken: null,+ expiresAt: null,+ projectId: null,+ copilotToken: null,+ providerSpecificData: {},+ connectionId: "noauth",+ testStatus: "active",+ lastError: null,+ lastErrorType: null,+ lastErrorSource: null,+ errorCode: null,+ rateLimitedUntil: null,+ maxConcurrent: null,+ };+ }+const allowSuppressedConnections = options.allowSuppressedConnections === true;const bypassQuotaPolicy = options.bypassQuotaPolicy === true;const forcedConnectionId =