← All comparisons

Spanlens vs Portkey · 2026

Both sit in front of the provider. The difference is which half is open.

Summary

Portkey and Spanlens both let you change a base URL instead of wrapping call sites, so the architectures rhyme. They part company on what you get to run: Portkey's MIT repository is the gateway, and the observability platform it feeds is commercial, while Spanlens ships the proxy and the dashboard in one MIT repository you can host yourself. Portkey is further ahead on routing, guardrails, and community size. Spanlens is further ahead on cost attribution, agent traces, and evaluation.

At a glance: Spanlens vs Portkey (2026)

Side-by-side feature comparison of Spanlens and Portkey in 2026.
FeatureSpanlensPortkey
Licence covering the observability productMITCommercial
Licence covering the gateway or proxyMITMIT
Self-host the whole productYesNo
Single-command Docker installYesPartial
GitHub stars (2026-07-30)1012,593
One-line baseURL swapYesYes
Works without touching call sitesYesYes
OpenTelemetry (OTLP) ingestYesPartial
Config file required to startNoPartial
Per-request USD in the logYesYes
Dated model variant pricingYesPartial
Cost by prompt versionYesNo
Cost by end user and sessionYesPartial
Cheaper-model recommendations with a dollar figureYesNo
Agent trace waterfallYesPartial
Critical path markedYesNo
LLM-as-judge evaluationYesPartial
Prompt A/B with significance testYesNo
Human annotation with judge correlationYesNo
Response cachingYesYes
Provider fallback and load balancingNoYes
Request guardrailsPartialYes
Virtual keys and per-team budgetsPartialYes
Log durability queue on analytics-store failureYesNo
Statistical anomaly detectionYesNo
PII and prompt-injection scanningYesPartial
Data export (CSV, JSONL, JSON)YesPartial

Updated 2026-07-30. Scroll for the grouped view with notes below.

Why teams pick Spanlens over Portkey

The part you compare is the part Portkey keeps

Portkey publishes its gateway under MIT, and that repository is the routing layer. The observability you would actually evaluate against a tool like this, the request log, the cost views, the traces, lives in the commercial platform. With Spanlens the dashboard and the proxy are the same MIT repository, so self-hosting gives you the product rather than the front door to it.

Cost is the first column, not an add-on

Spanlens computes per-request USD from the provider response at the moment it passes through, matched to the exact dated model id such as gpt-4o-mini-2024-07-18, and aggregates it by prompt version and by end user. Gateways tend to treat spend as a budget guard rather than as the number you open the dashboard to read.

Agent traces with the critical path marked

When an agent calls five tools in sequence, both tools can show you spans. Spanlens marks the longest dependency chain so you know which span to fix, rather than eyeballing a waterfall.

Prompt A/B with a significance test attached

Spanlens splits live traffic between two prompt versions and reports a Welch t-test on latency and cost plus a z-test on error rate. You get an answer about whether v8 beat v7 rather than two averages that look different.

Public repository activity you can check

The Portkey gateway repository had 26 commits between 1 May and 30 July 2026 and none after 25 May. Product work may well be happening in private repositories, but if you are choosing partly on the health of the open-source side, that is what the public record shows.

Feature-by-feature

Licence and hosting
Feature
Spanlens
Portkey
Licence covering the observability product
MIT
Commercial
Licence covering the gateway or proxy
MIT
MIT
Self-host the whole product
Portkey self-hosts the gateway; the observability platform is hosted.
Single-command Docker install
GitHub stars (2026-07-30)
10
12,593
Getting data in
Feature
Spanlens
Portkey
One-line baseURL swap
Works without touching call sites
OpenTelemetry (OTLP) ingest
Config file required to start
Cost
Feature
Spanlens
Portkey
Per-request USD in the log
Dated model variant pricing
Providers return ids like gpt-4o-mini-2024-07-18; matching them exactly is what makes the number right.
Cost by prompt version
Cost by end user and session
Cheaper-model recommendations with a dollar figure
Traces and quality
Feature
Spanlens
Portkey
Agent trace waterfall
Critical path marked
LLM-as-judge evaluation
Prompt A/B with significance test
Human annotation with judge correlation
Traffic management
Feature
Spanlens
Portkey
Response caching
Provider fallback and load balancing
Request guardrails
Spanlens detects PII and prompt injection at log time, with optional blocking. Portkey guardrails are broader.
Virtual keys and per-team budgets
Operations
Feature
Spanlens
Portkey
Log durability queue on analytics-store failure
Statistical anomaly detection
PII and prompt-injection scanning
Data export (CSV, JSONL, JSON)

Last updated 2026-07-30 · Spot something inaccurate? Let us know.

When Portkey might be the better fit

We don't think every team should pick us. Here's where Portkey legitimately wins.

Guardrails and routing are deeper

Portkey ships request guardrails, conditional routing, load balancing across providers, and caching as first-class gateway features with a longer track record. Spanlens caches responses on request and proxies ten providers, but it is not trying to be your traffic manager.

Much larger community

The Portkey gateway has 12,593 GitHub stars against Spanlens at 10, verified 30 July 2026. That gap is real: more integrations have been exercised, more edge cases have been reported, and more answers already exist when you search for an error message.

You may want the managed dashboard

If you would rather not run an observability stack at all, paying for a hosted platform is a legitimate answer. Spanlens offers hosting too, but the reason to pick it is usually that you want the option to run everything yourself.

Enterprise gateway features

Virtual keys, per-team budgets, and provider-level access control are more developed on the Portkey side. Check both feature lists against your actual governance requirements before deciding.

Frequently asked questions

Why pick Spanlens over Portkey for "The part you compare is the part Portkey keeps"?

Portkey publishes its gateway under MIT, and that repository is the routing layer. The observability you would actually evaluate against a tool like this, the request log, the cost views, the traces, lives in the commercial platform. With Spanlens the dashboard and the proxy are the same MIT repository, so self-hosting gives you the product rather than the front door to it.

Why pick Spanlens over Portkey for "Cost is the first column, not an add-on"?

Spanlens computes per-request USD from the provider response at the moment it passes through, matched to the exact dated model id such as gpt-4o-mini-2024-07-18, and aggregates it by prompt version and by end user. Gateways tend to treat spend as a budget guard rather than as the number you open the dashboard to read.

Why pick Spanlens over Portkey for "Agent traces with the critical path marked"?

When an agent calls five tools in sequence, both tools can show you spans. Spanlens marks the longest dependency chain so you know which span to fix, rather than eyeballing a waterfall.

Why pick Spanlens over Portkey for "Prompt A/B with a significance test attached"?

Spanlens splits live traffic between two prompt versions and reports a Welch t-test on latency and cost plus a z-test on error rate. You get an answer about whether v8 beat v7 rather than two averages that look different.

Why pick Spanlens over Portkey for "Public repository activity you can check"?

The Portkey gateway repository had 26 commits between 1 May and 30 July 2026 and none after 25 May. Product work may well be happening in private repositories, but if you are choosing partly on the health of the open-source side, that is what the public record shows.

When is Portkey a better fit than Spanlens for "Guardrails and routing are deeper"?

Portkey ships request guardrails, conditional routing, load balancing across providers, and caching as first-class gateway features with a longer track record. Spanlens caches responses on request and proxies ten providers, but it is not trying to be your traffic manager.

When is Portkey a better fit than Spanlens for "Much larger community"?

The Portkey gateway has 12,593 GitHub stars against Spanlens at 10, verified 30 July 2026. That gap is real: more integrations have been exercised, more edge cases have been reported, and more answers already exist when you search for an error message.

When is Portkey a better fit than Spanlens for "You may want the managed dashboard"?

If you would rather not run an observability stack at all, paying for a hosted platform is a legitimate answer. Spanlens offers hosting too, but the reason to pick it is usually that you want the option to run everything yourself.

When is Portkey a better fit than Spanlens for "Enterprise gateway features"?

Virtual keys, per-team budgets, and provider-level access control are more developed on the Portkey side. Check both feature lists against your actual governance requirements before deciding.

If you want a traffic manager with guardrails and are happy to pay for the dashboard, Portkey is a reasonable choice. If you want the observability itself to be the open part, and cost per request to be the first thing you see, try Spanlens.

Free tier · No credit card · Self-host with Docker