omniroute

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OmniRoute

OmniRoute

Local/remote AI gateway exposing OpenAI-compatible REST. One key, 207+ providers, auto-fallback, RTK token saver, MCP server, A2A agents.
支持 OpenAI 兼容 REST 接口的本地/远程 AI 网关。一个密钥接入 207+ 服务商,支持自动回退、RTK token 节省器、MCP server 和 A2A agent。

Setup

配置

bash
export OMNIROUTE_URL="http://localhost:20128"      # or VPS / tunnel URL
export OMNIROUTE_KEY="sk-..."                       # from Dashboard → API Keys
All requests:
${OMNIROUTE_URL}/v1/...
with
Authorization: Bearer ${OMNIROUTE_KEY}
.
Verify:
curl $OMNIROUTE_URL/api/health
→
{"ok":true}
bash
export OMNIROUTE_URL="http://localhost:20128"      # 或使用 VPS / 隧道 URL
export OMNIROUTE_KEY="sk-..."                       # 来自 Dashboard → API Keys
所有请求:
${OMNIROUTE_URL}/v1/...
,并设置
Authorization: Bearer ${OMNIROUTE_KEY}
。
验证:
curl $OMNIROUTE_URL/api/health
→
{"ok":true}

Discover models

发现模型

bash
curl $OMNIROUTE_URL/v1/models                  # chat/LLM (default)
curl $OMNIROUTE_URL/v1/models/image            # image-gen
curl $OMNIROUTE_URL/v1/models/tts              # text-to-speech
curl $OMNIROUTE_URL/v1/models/embedding        # embeddings
curl $OMNIROUTE_URL/v1/models/web              # web search + fetch
curl $OMNIROUTE_URL/v1/models/stt              # speech-to-text
Use
data[].id
as
model
field in requests. Combos appear with
owned_by:"combo"
.
bash
curl $OMNIROUTE_URL/v1/models                  # 聊天/LLM(默认)
curl $OMNIROUTE_URL/v1/models/image            # 图像生成
curl $OMNIROUTE_URL/v1/models/tts              # 文本转语音
curl $OMNIROUTE_URL/v1/models/embedding        # embeddings
curl $OMNIROUTE_URL/v1/models/web              # 网页搜索 + 抓取
curl $OMNIROUTE_URL/v1/models/stt              # 语音转文本
在请求中将
data[].id
用作
model
字段。组合模型会显示
owned_by:"combo"
。

Capability skills

能力 skills

CLI skills (omniroute binary)

CLI skills(omniroute binary)

Errors

错误

  • 401
    → set/refresh
    OMNIROUTE_KEY
    (Dashboard → API Keys)
  • 400 Invalid model format
    → check
    model
    exists in
    /v1/models/<kind>
  • 503 Provider circuit open
    → upstream provider down; retry after
    Retry-After
    seconds
  • 429
    → rate limited; honor
    Retry-After
  • 401
    → 设置或刷新
    OMNIROUTE_KEY
    (Dashboard → API Keys)
  • 400 Invalid model format
    → 检查
    model
    是否存在于
    /v1/models/<kind>
    中
  • 503 Provider circuit open
    → 上游提供商不可用;在
    Retry-After
    指定的秒数后重试
  • 429
    → 触发速率限制;遵循
    Retry-After

Differentiators vs OpenAI direct

相比直接使用 OpenAI 的差异化优势

  • Auto-fallback combos (14 strategies): never stop coding even if a provider rate-limits
  • RTK token saver: tool_result compressed via 47 specialized filters (git-diff, test-jest, terraform-plan, docker-logs…) — 20-40% token reduction
  • Caveman mode: optional terse system prompt injection (LITE/FULL/ULTRA) — 15-25% completion reduction
  • MCP + A2A servers built-in (this is the only AI router that exposes both protocols)
  • Memory with FTS5 + Qdrant for persistent agent context
  • Guardrails for PII masking, prompt injection detection, vision policies
  • 自动回退组合(14 种策略):即使提供商触发速率限制,也不会停止编码
  • RTK token 节省器:通过 47 个专用过滤器压缩 tool_result(git-diff、test-jest、terraform-plan、docker-logs……)——减少 20–40% token
  • Caveman 模式:可选的简洁系统提示词注入(LITE/FULL/ULTRA)——减少 15–25% 的补全内容
  • 内置 MCP + A2A server(这是唯一同时暴露两种协议的 AI 路由器)
  • Memory:使用 FTS5 + Qdrant 实现持久化 agent 上下文
  • Guardrails:支持 PII 掩码、提示词注入检测和视觉策略