Sparring
Product · The Gateway

One URL change. Every AI conversation guard-railed, logged and evaluated.

Point the SDK you already use at Sparring. Model tokens are metered at the provider's list price × 1.05 — zero on your own keys. Every request is checked inline before and after the model, every response is logged without bodies, sampled conversations are scored with cited evidence, and incidents become regression tests automatically. If we are ever unreachable, your application falls back to the provider: fail-open by design.

Connect in one line

Keep your code, your models and your prompts. Change the base URL.

Anthropic SDK
// Before                                   // After — one line
import Anthropic from "@anthropic-ai/sdk";    import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({                const client = new Anthropic({
  apiKey: proces...KEY           baseURL: "https://app.sparringhq.com/api/v1/models/anthropic",
});                                             apiKey: proces...KEY      // your Sparring key
                                              });
OpenAI SDK
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://app.sparringhq.com/api/v1/models/openai/v1", apiKey: proces...KEY });
const r = await client.chat.completions.create({ model: "gpt-6-astra", messages });
// r.headers: X-Sparring-Guardrail: pass · X-Sparring-Upstream: managed · X-Sparring-CU: 0.1 · X-Sparring-Credits: 0.0041
Anthropic Messages (/v1/models/anthropic/v1/messages)
OpenAI Chat Completions (/v1/models/openai/v1/chat/completions)
OpenAI Responses (/v1/models/openai/v1/responses)

What the gateway does

Four things happen to every request. None of them changes what your model says — unless you ask for block mode.

Guardrails, inline

Deterministic checks on the request and the response — PII (cards, national IDs, API keys), crisis language, and your own tripwire rules — in under 5 ms, no model call. Flag mode reports the verdict in a header; block mode stops a critical request with a 422 or replaces a critical response with a safe refusal.

Routing with fail-over

By default your traffic runs on Vertex AI inside Sparring's Google Cloud project (Gemini and Claude). You can switch an organisation to Sparring's managed channel or your own key, and you can disable non-Google fail-over entirely for data residency. A channel that errors is cooled down for 60 seconds and skipped. X-Sparring-Failover tells you when it happened.

Evaluation, asynchronous

A sample of conversations — and every flagged one — is scored after the response is sent by the same evidence judge that powers Arena: outcome, skills, strengths and weaknesses that quote the exact words. Findings land in GET /v1/findings and in your console.

Incidents become tests

A critical finding on production traffic is turned into a draft Arena scenario in your library. Approve it, and every release runs against the failure that actually happened. The longer you run, the larger your regression suite.

Fail-open

Never your single point of failure.

If the gateway is unreachable or /v1/health reports down, your SDK falls back to the provider directly. You lose guardrails and logging for that window — never your service. Sparring is designed not to be a single point of failure.

GET /v1/health needs no key and is not billed. It reports gateway liveness, database state and per-channel health, so your client can decide in one call.

Client-side fallback
// Fail-open: Sparring must never be your single point of failure.
const health = await fetch("https://app.sparringhq.com/api/v1/health").then(r => r.ok).catch(() => false);
const client = new Anthropic(health
  ? { baseURL: "https://app.sparringhq.com/api/v1/models/anthropic", apiKey: SPARRING_KEY }
  : { apiKey: ANTHROPIC_KEY });   // direct to the provider: no guardrails for this window, no outage
Headers

Every response tells you what happened.

X-Sparring-Guardrailpass · flag:<rules> · block:<rules> — the inline verdict for this request
X-Sparring-Upstreamvertex · byok · managed · official — which channel served it
X-Sparring-FailoverPresent when a channel was skipped; lists attempts
X-Sparring-CreditsModel tokens metered at list price × 1.05 (0 for BYOK)
X-Sparring-CUConversation Units billed for this request
X-Request-IdQuote it to support
A blocked request
HTTP/1.1 422 Unprocessable Entity
X-Sparring-Guardrail: block:pii.card_number
{ "error": { "type": "guardrail_blocked",
             "message": "Request blocked by your organisation's Sparring guardrail policy",
             "rules": ["pii.card_number"], "request_id": "req_…" } }

Streams are never cut mid-flight (that would corrupt your parser); a critical hit on a streamed response is flagged and evaluated, not blocked.

Three channels to a model

Google Cloud native by default; the other two are opt-in. Assurance work is metered the same way on all three.

ChannelWhat it meansAvailability
Vertex AI — Google Cloud native (default)Gemini 4 served from Vertex AI inside Sparring's Google Cloud project, metered at Google's list price × 1.05. Requests never leave Google Cloud.All plans
Sparring managed channelClaude and GPT families via Sparring's provider channel, metered at the provider's list price × 1.05; also the fail-over when Vertex is unavailable (can be disabled).All plans
Bring your own keyYour Anthropic / OpenAI account; key encrypted at rest, never logged. Tokens not metered; CU only.Team and above
Governance
  • Per-organisation model allow-list
  • Monthly budget in credits with hard stop and 80% alert
  • Per-key requests-per-minute
  • Guardrail policy: off · flag · block; PII, crisis, custom tripwires
  • Evaluation policy: sample rate; flagged exchanges always evaluated
  • Region policy: gcp-resident tenants pinned to Vertex AI
  • Request log without bodies by default; bodies only with explicit opt-in
  • Idempotency keys; X-Request-Id on every response
Presets (opt-in, disclosed in the header)
noneRaw passthrough — your prompt, our routing and governance
coachSparring's coach preset prepended: structured, evidence-citing feedback style
judgeSparring's judge preset: outcome/performance separation, quoted evidence, SCS skills

What it costs

Tokens pass through at list. You pay for assurance work in Conversation Units — defined by the work, not by the model behind it.

WorkCUAt list
Gateway request (inline guardrail, both sides)0.1 CU$0.01
Conversation evaluated (evidence judge)20 CU$2.00
Simulated counterpart turn5 CU$0.50
Arena session (red-team run of your agent)125 CU$12.50
Practice session (human, with debrief)200 CU$20.00
Plans and the free tier

The capability API

The same engine, callable directly when you have your own harness.

POST /v1/evaluate

Send any transcript — a support chat, a sales call, an agent log. Outcome, 0–3 skill ratings on the SCS, strengths and weaknesses that quote the exact words, rewrites. A verifier removes any claim it cannot find.

POST /v1/simulate

A counterpart with a stance, a hidden motive and pressure tactics for your own test harness — stateless, streamed. Plug it into Promptfoo, DeepEval or a plain script.

POST /v1/guardrail

The gateway's tripwire engine as a batch endpoint — up to 500 texts a call, negation-aware, severity and matched span.

EndpointUnitRate
POST /v1/models/*per request · Guardrails on; tokens 0 for BYOK0.1 CU + tokens at list × 1.05
POST /v1/evaluateper transcript evaluated · Up to 8k input tokens; +10 CU per additional 8k20 CU
POST /v1/simulateper counterpart turn · ≈ 50–75 CU per full conversation5 CU
POST /v1/guardrailper 100 checks · Deterministic; negation-aware10 CU
POST /v1/sessions …per session · Same as the app200 CU practice · 125 CU arena
Data

Bodies are not stored. Verdicts are.

Gateway requests are logged as metadata: request id, model, channel, token counts, latency, guardrail verdict. Prompt and completion bodies are forwarded and discarded. Evaluation stores the judge's findings with quoted evidence; the transcript excerpt is kept only if you turn on keep_bodies. BYOK keys are AES-256-GCM encrypted and never logged.

What is not allowed

Governed means governed.

  • ●Reselling access to third parties or operating a public API storefront on top of Sparring
  • ●Prompting for content that targets real individuals (social engineering, harassment)
  • ●Employment, credit, insurance or legal decisions about individuals
  • ●Training or distilling models from outputs
  • ●Anything the upstream model provider's usage policy prohibits — it applies in full
Acceptable Use Policy

Questions engineers ask

What does the gateway add to latency?+
Guardrails are deterministic and run in under 5 ms on both sides. Routing adds one hop inside Google Cloud (asia-east1). Evaluation is asynchronous and never on the request path. Streams are forwarded chunk by chunk.
What happens if Sparring is down?+
If the gateway is unreachable or /v1/health reports down, your SDK falls back to the provider directly. You lose guardrails and logging for that window — never your service. Sparring is designed not to be a single point of failure.
Is block mode safe for production?+
Block only triggers on critical hits — card numbers, API keys, crisis language, or rules you mark critical. Major and minor hits are flagged, never blocked. Streamed responses are never cut; they are flagged and evaluated. Start in flag mode, read your findings for a week, then decide.
Do you store our prompts and transcripts?+
Gateway calls store no bodies — only ids, model, channel, token counts, latency and the guardrail verdict. Evaluation stores findings with quoted evidence; excerpts only with keep_bodies on. Capability calls (evaluate, simulate) keep what is needed to render their result, with configurable retention.
Which models are behind the gateway?+
By default, Gemini 4 on Vertex AI inside Google Cloud (GET /v1/models lists models with list prices); Claude and GPT families via the Sparring managed channel if you opt in; anything your own key can reach via BYOK, and Vertex AI for GCP-resident tenants. Your allow-list applies on every channel.
Rate limits?+
120 requests per minute per key by default, configurable 10–600. Monthly credit budgets with a hard stop (HTTP 402) and an alert at 80%. Idempotency-Key is honoured for 24 hours.

Start on Google Cloud Marketplace.

Sign in, open Settings → Developer, copy the base URL, change one line. Tokens at list, guardrails from the first request.