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
import { requireManagementAuth } from "@/lib/api/requireManagementAuth";
import { createErrorResponseFromUnknown } from "@/lib/api/errorResponse";
import { getSubscriptionById } from "@/lib/proxySubscription";
type RouteCtx = { params: Promise<{ id: string }> };
/**
* GET /api/v1/management/proxy-subscriptions/:id/nodes — return the last-parsed
* node summary for display without re-fetching the (possibly slow) subscription.
*/
export async function GET(request: Request, ctx: RouteCtx) {
const authError = await requireManagementAuth(request);
if (authError) return authError;
try {
const { id } = await ctx.params;
const sub = await getSubscriptionById(id);
if (!sub) return Response.json({ error: "Subscription not found" }, { status: 404 });
return Response.json({
id: sub.id,
name: sub.name,
mode: sub.mode,
enabled: sub.enabled,
status: sub.status,
error: sub.error,
lastFetchedAt: sub.lastFetchedAt,
nodes: sub.lastNodes ?? [],
});
} catch (error) {
return createErrorResponseFromUnknown(error, "Failed to load proxy subscription nodes");
}
}