mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-05-05 09:46:30 +00:00
OmniRoute is an intelligent API gateway that unifies 20+ AI providers behind a single OpenAI-compatible endpoint. Features include intelligent routing with 6 strategies, multi-format translation (OpenAI/Claude/Gemini/Responses API), circuit breakers, semantic caching, combo fallback chains, real-time health monitoring, and a full dashboard with provider management, analytics, and CLI tool integration. Key highlights: - 20+ providers (Claude Code, Codex, Gemini CLI, GitHub Copilot, iFlow, Qwen, Kiro, etc.) - 6 routing strategies (Fill First, Round Robin, P2C, Random, Least Used, Cost Optimized) - Export/Import database backup with full archive support - Translator Playground with 4 modes (Playground, Chat Tester, Test Bench, Live Monitor) - 100% TypeScript across src/ and open-sse/ - Docker support with multi-stage builds - Comprehensive documentation and 9 dashboard screenshots
53 lines
1.3 KiB
Bash
Executable file
53 lines
1.3 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Defaults requested
|
|
BASE_URL="${BASE_URL:-https://omniroute.com/v1}"
|
|
MODEL="${MODEL:-kr/claude-sonnet-4.5}"
|
|
TIMEOUT_SECONDS="${TIMEOUT_SECONDS:-45}"
|
|
API_KEY="${API_KEY:-${CLOUD_API_KEY:-${OPENAI_API_KEY:-}}}"
|
|
|
|
ENDPOINT="${BASE_URL%/}/chat/completions"
|
|
|
|
if [[ -z "${API_KEY}" ]]; then
|
|
echo "[cloud-test] FAIL: API key not configured."
|
|
echo "[cloud-test] Set one of: API_KEY, CLOUD_API_KEY, OPENAI_API_KEY"
|
|
exit 2
|
|
fi
|
|
|
|
echo "[cloud-test] Endpoint: ${ENDPOINT}"
|
|
echo "[cloud-test] Model: ${MODEL}"
|
|
echo "[cloud-test] API key: ${API_KEY:0:8}...${API_KEY: -6}"
|
|
|
|
PAYLOAD=$(cat <<JSON
|
|
{
|
|
"model": "${MODEL}",
|
|
"stream": false,
|
|
"messages": [
|
|
{ "role": "user", "content": "Reply with exactly: CLOUD_OK" }
|
|
],
|
|
"max_tokens": 64
|
|
}
|
|
JSON
|
|
)
|
|
|
|
HTTP_CODE=$(curl -sS -m "${TIMEOUT_SECONDS}" \
|
|
-o /tmp/omniroute_cloud_test_response.json \
|
|
-w "%{http_code}" \
|
|
-X POST "${ENDPOINT}" \
|
|
-H "Authorization: Bearer ${API_KEY}" \
|
|
-H "Content-Type: application/json" \
|
|
--data "${PAYLOAD}" || true)
|
|
|
|
echo "[cloud-test] HTTP status: ${HTTP_CODE}"
|
|
echo "[cloud-test] Response body:"
|
|
cat /tmp/omniroute_cloud_test_response.json || true
|
|
echo
|
|
|
|
if [[ "${HTTP_CODE}" =~ ^2 ]]; then
|
|
echo "[cloud-test] PASS"
|
|
exit 0
|
|
fi
|
|
|
|
echo "[cloud-test] FAIL"
|
|
exit 1
|