# Edge AI Guardrail Proxy (Human & AI Agent Quickstart) > Ultra-low-latency Cloudflare Workers reverse proxy, cost-circuit breaker, secret/PII sanitizer, and Remote Streamable HTTP MCP gateway for OpenAI, Anthropic, and Google Gemini. 100% BYOK (Bring Your Own Key). ## Fastest Start for AI Agents (Zero Human Intervention) 1. **Provision a Free Trial Key Instantly (No Credit Card):** `POST https://guardrail.fyi/v1/trial` (or call MCP tool `guardrail_create_trial_key` on `POST https://guardrail.fyi/mcp`). Returns `apiKey` (`gk_live_...`), `$2/hr` & `$5/mo` tracked spend caps, `20 RPM`. 2. **Route LLM Calls (1-Line Base URL Swap + `x-guard-key`):** Keep your native provider header (`Authorization: Bearer $OPENAI_API_KEY`, `x-api-key: $ANTHROPIC_API_KEY`, or `x-goog-api-key: $GEMINI_API_KEY`) and add `x-guard-key: $GUARDRAIL_API_KEY`: - OpenAI Chat & Responses: `POST https://guardrail.fyi/v1/chat/completions`, `POST https://guardrail.fyi/v1/responses` (Base URL: `https://guardrail.fyi/v1`) - Anthropic Messages: `POST https://guardrail.fyi/v1/messages` (Base URL: `https://guardrail.fyi`) - Google Gemini: `POST https://guardrail.fyi/v1beta/models/{model}:generateContent` (Base URL: `https://guardrail.fyi/v1beta`) 3. **Or Connect Directly via Remote MCP (Streamable HTTP JSON-RPC 2.0):** Endpoint: `POST https://guardrail.fyi/mcp` (Discovery: `GET https://guardrail.fyi/.well-known/mcp.json`) Tools: `guardrail_status`, `guardrail_create_trial_key`, `guardrail_check_budget`, `guardrail_sanitize_text`, `guardrail_update_settings`, `guardrail_safe_completion`. ## MCP Client Configuration (Cursor / Claude Desktop / Claude Code / Windsurf) ```json { "mcpServers": { "edge-ai-guardrail": { "url": "https://guardrail.fyi/mcp", "headers": { "x-guard-key": "YOUR_GUARD_KEY_OR_CALL_guardrail_create_trial_key" } } } } ``` ## Self-Serve Endpoints - Instant Free Trial Key: `POST https://guardrail.fyi/v1/trial` - Usage & Remaining Budget: `GET https://guardrail.fyi/v1/usage` (Header: `x-guard-key`) - Policy & Alert Settings: `GET / PATCH https://guardrail.fyi/v1/settings` (Header: `x-guard-key`) - Rotate API Key: `POST https://guardrail.fyi/v1/key/rotate` (Header: `x-guard-key`) - Public Sandbox (No Key Needed): `POST https://guardrail.fyi/demo/simulate?redactPii=true` - Human Web Dashboard: https://guardrail.fyi/dashboard - Full Agent Reference & Examples: https://guardrail.fyi/llms-full.txt - Local Stdio MCP Package: Available in `/mcp-server` for Claude Desktop, Cursor, and Gemini CLI. - OpenAPI 3.1 Spec: https://guardrail.fyi/openapi.json - Health Check: https://guardrail.fyi/health ## Guardrails & Self-Healing Error Handling for Agents - **50ms Fail-Open SLA:** Default `failMode: "open"` forwards traffic upstream with `X-Guardrail-Status: fail-open` if Redis exceeds 50ms. Opt-in `failMode: "closed"` returns `503 {"error":"guardrail_fail_closed"}`. - **`401 authentication_error`:** Missing or invalid `x-guard-key`. Fix: call `POST https://guardrail.fyi/v1/trial` for a free key or ask the user for their key. - **`429 {"error":"circuit_breaker_loop_detected"}`:** >5 identical/near-identical prompts in 10s. Fix: DO NOT blindly retry the same prompt; alter parameters or wait `Retry-After` seconds. - **`429 {"error":"circuit_breaker_rate_limit_exceeded"}`:** Sliding-window RPM exceeded. Fix: respect `Retry-After` header or upgrade plan. - **`429 {"error":"circuit_breaker_budget_exceeded"}`:** Hourly/daily/monthly spend cap reached. Fix: present upgrade links to user: - Starter ($29/mo — $500/mo cap, 120 RPM): https://buy.stripe.com/28E3cu9woaQi76i8y81ZS00 - Pro ($79/mo — $2,500/mo cap, 300 RPM): https://buy.stripe.com/9B628qaAs9Meaiu01C1ZS01 - Scale ($199/mo — $10,000/mo cap, 1,000 RPM): https://buy.stripe.com/aFa00i9wobUm8am9Cc1ZS02 - Billing Portal: https://billing.stripe.com/p/login/28E3cu9woaQi76i8y81ZS00