Skip to content
GitHub
Compute SDK

Product

Benchmarks

Resources

Docs Blog Become a partner

AI Gateway Performance Benchmark

AI Gateway Benchmarks

Benchmark AI gateway latency and token throughput, measured against a direct Anthropic baseline. Inspired by this benchmark from Ronny Badilla.

Powered by Namespace · 4 vCPU / 16GB RAM · Northern Virginia, US

Provider Leaderboard

"Anthropic (Direct)" is a no-gateway control, not a competing gateway — it isolates how much latency each gateway adds on top of the underlying model provider.

Provider VarianceComposite Score

"Anthropic (Direct)" is a no-gateway control, not a competing gateway.
Delta vs. the Anthropic (Direct)'s composite score. Positive is better than baseline; negative is worse.

Performance Over Time

Composite Score

Detailed Metrics

Provider
Score
Cold E2E (med)
Warm TTFT (med)
Tokens/sec (med)
DNS (med)
TCP (med)
TLS (med)
Success
Cloudflare AI Gateway90.0657ms624ms880.90ms0.87ms5.88ms100%
Pydantic AI Gateway89.8727ms583ms860.86ms1.64ms4.80ms100%
Anthropic (Direct)Baseline89.3821ms521ms880.83ms1.08ms2.93ms100%
OpenRouter89.2941ms785ms1010.86ms1.26ms3.51ms100%
Vercel AI Gateway88.8831ms739ms880.87ms5.66ms20.26ms100%
LLMgateway88.5718ms602ms890.86ms1.46ms5.16ms100%

Want to see a gateway added?

Let us know on X

Methodology

Every run executes on a GitHub Actions runner hosted by Namespace, physically located in Northern Virginia, US. Since results are a property of the network they're measured from, treat rankings as relative to that vantage point rather than a universal number — see Limitations in the full methodology.

What We Measure

Every gateway is hit directly with the same prompt and model (Claude Haiku 4.5), addressed the way each API expects it to be addressed — no gateway is proxied through another. Each request is either cold (a brand-new TCP+TLS connection, opened from scratch) or warm (a second request reusing an already-open keep-alive connection).

Cold requests are broken into DNS, TCP, and TLS phases (real socket timestamps, not estimates), plus time to first response byte and first streamed token. Every request also records output tokens/sec and success/failure.

Anthropic (Direct) is a no-gateway control, not a competing participant — it isolates how much latency each gateway adds on top of the underlying model provider. Full methodology, including how "cold" and "warm" are defined and their limitations, is documented in the public benchmarks repo.

How We Score

The Composite Score combines cold end-to-end latency and warm time-to-first-token — the short-lived-process case and the steady-state case — with generation throughput, all multiplied by success rate.

  • Cold E2E median: 30%
  • Warm TTFT median: 30%
  • Cold E2E P95: 15%
  • Warm TTFT P95: 15%
  • Tokens/sec: 10%
PartnersLatitude