Skip to content

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

feat(mitm): add remaining targets (cursor/zed/claudeCode/openCode/trae) (F3)

diegosouzapwbed254954c51
diff --git a/src/mitm/targets/claudeCode.ts b/src/mitm/targets/claudeCode.ts
new file mode 100644
index 0000000000..e86db2df94
--- /dev/null
+++ b/src/mitm/targets/claudeCode.ts
@@ -0,0 +1,37 @@
+/**
+ * Claude Code (Anthropic CLI) — MITM target descriptor.
+ *
+ * Hosts: `api.anthropic.com`.
+ * Format: Anthropic Messages API on `/v1/messages`.
+ *
+ * NOTE: shares the host `api.anthropic.com` with the Kiro target. The DNS-routing
+ * tutorial therefore is opt-in: the user explicitly enables interception when
+ * they want Claude Code traffic captured.
+ */
+import type { MitmTarget } from "../types";
+
+export const CLAUDE_CODE_TARGET: MitmTarget = {
+ id: "claude-code",
+ name: "Claude Code",
+ icon: "terminal",
+ color: "#D97706",
+ hosts: ["api.anthropic.com"],
+ port: 443,
+ endpointPatterns: ["/v1/messages"],
+ defaultModels: [
+ { id: "claude-sonnet-4.5", name: "Claude Sonnet 4.5", alias: "claude-sonnet-4.5" },
+ { id: "claude-opus-4.5", name: "Claude Opus 4.5", alias: "claude-opus-4.5" },
+ ],
+ setupTutorial: {
+ steps: [
+ "Install Claude Code (Anthropic CLI)",
+ "Install OmniRoute's root certificate",
+ "Enable DNS routing for Claude Code",
+ "Run `claude` — requests are now proxied via OmniRoute",
+ ],
+ detection: { command: "which claude", platform: "all" },
+ },
+ handler: () =>
+ import("../handlers/claudeCode").then((m) => ({ default: m.ClaudeCodeHandler })),
+ riskNoticeKey: "providers.riskNotice.oauth",
+};
diff --git a/src/mitm/targets/cursor.ts b/src/mitm/targets/cursor.ts
new file mode 100644
index 0000000000..2c907208ec
--- /dev/null
+++ b/src/mitm/targets/cursor.ts
@@ -0,0 +1,33 @@
+/**
+ * Cursor IDE — MITM target descriptor.
+ *
+ * Hosts: `api2.cursor.sh` (chat backend).
+ * Format: OpenAI-compatible Chat Completions on `/v1/chat/completions`.
+ */
+import type { MitmTarget } from "../types";
+
+export const CURSOR_TARGET: MitmTarget = {
+ id: "cursor",
+ name: "Cursor IDE",
+ icon: "edit_note",
+ color: "#0EA5E9",
+ hosts: ["api2.cursor.sh"],
+ port: 443,
+ endpointPatterns: ["/v1/chat/completions"],
+ defaultModels: [
+ { id: "claude-sonnet-4.5", name: "Claude Sonnet 4.5", alias: "claude-sonnet-4.5" },
+ { id: "gpt-4o", name: "GPT-4o", alias: "gpt-4o" },
+ ],
+ setupTutorial: {
+ steps: [
+ "Install OmniRoute's root certificate",
+ "Enable DNS routing for Cursor",
+ "Restart Cursor IDE",
+ "Done — Cursor traffic now routes through OmniRoute",
+ ],
+ detection: { command: "which cursor", platform: "all" },
+ },
+ handler: () =>
+ import("../handlers/cursor").then((m) => ({ default: m.CursorHandler })),
+ riskNoticeKey: "providers.riskNotice.oauth",
+};
diff --git a/src/mitm/targets/openCode.ts b/src/mitm/targets/openCode.ts
new file mode 100644
index 0000000000..206adc6b3e
--- /dev/null
+++ b/src/mitm/targets/openCode.ts
@@ -0,0 +1,34 @@
+/**
+ * OpenCode — MITM target descriptor.
+ *
+ * Hosts: `opencode.ai`.
+ * Format: OpenAI-compatible Chat Completions on `/v1/chat/completions`.
+ */
+import type { MitmTarget } from "../types";
+
+export const OPEN_CODE_TARGET: MitmTarget = {
+ id: "open-code",
+ name: "OpenCode",
+ icon: "code",
+ color: "#22D3EE",
+ hosts: ["opencode.ai"],
+ port: 443,
+ endpointPatterns: ["/v1/chat/completions"],
+ defaultModels: [
+ { id: "gpt-4o", name: "GPT-4o", alias: "gpt-4o" },
+ { id: "claude-3.5-sonnet", name: "Claude 3.5 Sonnet", alias: "claude-3.5-sonnet" },
+ ],
+ setupTutorial: {
+ steps: [
+ "Install the OpenCode CLI/IDE",
+ "Install OmniRoute's root certificate",
+ "Enable DNS routing for OpenCode",
+ "Restart OpenCode",
+ "Done — OpenCode traffic now routes through OmniRoute",
+ ],
+ detection: { command: "which opencode", platform: "all" },
+ },
+ handler: () =>
+ import("../handlers/openCode").then((m) => ({ default: m.OpenCodeHandler })),
+ riskNoticeKey: "providers.riskNotice.oauth",
+};
diff --git a/src/mitm/targets/trae.ts b/src/mitm/targets/trae.ts
new file mode 100644
index 0000000000..8561f2c42a
--- /dev/null
+++ b/src/mitm/targets/trae.ts
@@ -0,0 +1,32 @@
+/**
+ * Trae — MITM target descriptor (stub).
+ *
+ * Viability is still under investigation (see plan 11 §5). The hostname
+ * `trae.invalid` is a deliberate non-routable placeholder so the target is
+ * registered (UI can list it as "investigating") without ever matching real
+ * traffic. The concrete host list will be filled in once we confirm the
+ * upstream API surface.
+ */
+import type { MitmTarget } from "../types";
+
+export const TRAE_TARGET: MitmTarget = {
+ id: "trae",
+ name: "Trae",
+ icon: "construction",
+ color: "#94A3B8",
+ hosts: ["trae.invalid"],
+ port: 443,
+ endpointPatterns: [],
+ defaultModels: [],
+ setupTutorial: {
+ steps: [
+ "Trae integration is under investigation",
+ "Setup steps will be published once the upstream API is confirmed",
+ ],
+ detection: { command: "which trae", platform: "all" },
+ },
+ handler: () =>
+ import("../handlers/trae").then((m) => ({ default: m.TraeHandler })),
+ riskNoticeKey: "providers.riskNotice.investigating",
+ viability: "investigating",
+};
diff --git a/src/mitm/targets/zed.ts b/src/mitm/targets/zed.ts
new file mode 100644
index 0000000000..8833501ec4
--- /dev/null
+++ b/src/mitm/targets/zed.ts
@@ -0,0 +1,32 @@
+/**
+ * Zed IDE — MITM target descriptor.
+ *
+ * Hosts: `api.zed.dev`.
+ * Format: OpenAI-compatible Chat Completions on `/v1/chat/completions`.
+ */
+import type { MitmTarget } from "../types";
+
+export const ZED_TARGET: MitmTarget = {
+ id: "zed",
+ name: "Zed",
+ icon: "bolt",
+ color: "#EF4444",
+ hosts: ["api.zed.dev"],
+ port: 443,
+ endpointPatterns: ["/v1/chat/completions"],
+ defaultModels: [
+ { id: "claude-3.5-sonnet", name: "Claude 3.5 Sonnet", alias: "claude-3.5-sonnet" },
+ { id: "gpt-4o", name: "GPT-4o", alias: "gpt-4o" },
+ ],
+ setupTutorial: {
+ steps: [
+ "Install OmniRoute's root certificate",
+ "Enable DNS routing for Zed",
+ "Restart Zed",
+ "Done — Zed traffic now routes through OmniRoute",
+ ],
+ detection: { command: "which zed", platform: "all" },
+ },
+ handler: () => import("../handlers/zed").then((m) => ({ default: m.ZedHandler })),
+ riskNoticeKey: "providers.riskNotice.oauth",
+};