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
/**
* OAuth CLI Configuration
*
* Provides server credentials for OAuth CLI services to communicate
* with the running OmniRoute server when saving tokens.
*/
import { getRuntimePorts } from "@/lib/runtime/ports";
interface ServerCredentials {
server: string;
token: string;
userId: string;
}
function getDefaultApiServer() {
const { dashboardPort } = getRuntimePorts();
return `http://localhost:${dashboardPort}`;
}
/**
* Get server credentials from environment variables.
* Used by OAuth CLI services to save tokens to the running server.
*/
export function getServerCredentials(): ServerCredentials {
return {
server: process.env.OMNIROUTE_SERVER || process.env.SERVER_URL || getDefaultApiServer(),
token: process.env.OMNIROUTE_TOKEN || process.env.CLI_TOKEN || "",
userId: process.env.OMNIROUTE_USER_ID || process.env.CLI_USER_ID || "cli",
};
}