Browser-based relay / API gateway compatibility checker for OpenAI-compatible and Anthropic Messages endpoints.
Test whether a third-party relay matches expected routes, auth headers, streaming (SSE), and response shapes — with raw request/response JSON and a compliance checklist.
Repository: github.com/RomaCredit/relay-api-check
Live demo: https://check.romaapi.com
- Three API shapes: OpenAI Chat (
/v1/chat/completions), OpenAI Responses (/v1/responses), Anthropic Messages (/v1/messages) - Claude CLI real-client test (
/api/test-claude-cli) for keys that only accept Claude Code / Claude CLI (not plain HTTP) - Auto endpoint routing by model name (e.g.
claude*→ Anthropic,gpt-5.4→ Responses) - CORS proxy (
/api/proxy) for browser-side testing - Tabs: text reply, response detail (raw HTTP + body), request detail, compliance checks
- One-click test scenarios and diagnostic report export
- Auto scan (
/api/auto-scan): server-orchestrated discovery, protocol matrix, Agent probes (quick / standard / deep profiles); progress via SSE; optional Hub suite ingest
cd relay-api-check
cp .env.example .env
docker compose up -d --build- Frontend: static
frontend/index.html - Proxy:
http://proxy:8090(exposed only inside compose network; Caddy routes/api/proxy)
Some relay keys return only allows Claude Code clients on /v1/messages or /v1/chat/completions but work when called via the official Claude CLI (claude -p).
In the UI, choose Claude CLI · claude -p 真实客户端. The backend runs (no shell):
claude -p "Reply with only: OK"
with environment:
ANTHROPIC_BASE_URL← Base URLANTHROPIC_AUTH_TOKEN← API KeyANTHROPIC_MODEL← Model (optional)ANTHROPIC_API_KEYcleared
Server requirements
-
Must run on a VPS / Docker / own server where you can install the CLI.
-
Not suitable for Vercel, Netlify, Cloudflare Pages, or other serverless hosts.
-
Before use, on the same machine/container that runs
api-check-proxy:claude --version
Install Claude Code / Claude CLI per Anthropic documentation (e.g. npm install -g @anthropic-ai/claude-code on the host, then ensure the proxy container can execute claude via PATH or mount the binary).
Optional env:
| Variable | Description |
|---|---|
CLAUDE_CLI_PATH |
Path to claude binary (default: claude) |
API keys are never logged or stored; responses only include a masked key (sk-abc…xyz1).
| Variable | Description |
|---|---|
ALLOWED_ORIGINS |
Comma-separated origins allowed to call /api/proxy (must match your UI URL) |
CLAUDE_CLI_PATH |
Executable for Claude CLI tests (default claude) |
HUB_SUITE_INGEST_URL |
Hub POST /api/relay-api-check/suite-ingest URL (optional; RomaAPI compose sets this) |
RELAY_API_CHECK_INGEST_SECRET |
Shared token header x-relay-check-ingest-token for Hub ingest (optional) |
See SECURITY.md before exposing the proxy publicly.
- Copy
deploy/Caddyfile.standaloneor adaptdeploy/nginx.conf.example - Set
ALLOWED_ORIGINS=https://check.yourdomain.com - Mount
frontend/as static files; reverse-proxy/api/proxyto the proxy service on port 8090
check.romaapi.com is wired in the root docker-compose.yml + caddy/Caddyfile.
Do not docker build on the production VPS (low memory). Use GitHub Actions + GHCR:
cd /path/to/romaapi.com
./scripts/deploy-api-check-proxy-via-github.shStatic frontend/ is bind-mounted; git pull updates the UI without rebuilding the proxy image.
If your relay already sends CORS headers, you can host only frontend/index.html on any static server and disable 「服务端代理」 in the UI.
Without the proxy, cross-origin relays will fail in the browser with CORS errors.
Open 自动扫描 in the UI (or ?mode=auto&base=…) to run a full relay profile without clicking through each protocol manually.
Auto-scan API:
| Method | Path | Description |
|---|---|---|
POST |
/api/auto-scan |
Start scan { baseUrl, apiKey, profile? } → { scanId } |
GET |
/api/auto-scan/{id} |
Status + report when done |
GET |
/api/auto-scan/{id}/events |
SSE progress |
relay-api-check/
├── frontend/index.html # Manual + auto scan UI
├── frontend/auto-scan.js # Auto scan tab logic
├── proxy/auto_scan/ # Orchestrator, discovery, compliance
├── specs/ # Protocol capability YAML
├── proxy/ # FastAPI CORS proxy
├── deploy/ # Caddy / Nginx examples
├── docker-compose.yml # Standalone stack
├── LICENSE
└── SECURITY.md
MIT — see LICENSE.