Compare

Niu, LiteLLM and OpenRouter

From your first model call to ongoing application operations: Niu combines Provider management, workspace budgets, transparent usage and billing, and text/video generation management. Compare it with LiteLLM for self-hosted gateway and SDK workflows, and OpenRouter for hosted model access.

Performance benchmark

Niu, New API and LiteLLM Proxy

Archived runs: Niu v0.2.4, New API 45fbb14 and LiteLLM Proxy v1.104.0.

Apple M4, 24 GB · PostgreSQL 17.11 · local zero-delay mock upstream. Historical synthetic results, not current-release or production capacity claims. OpenRouter was not tested.

RPS: requests/second · p99: 99th-percentile latency · coding sessions: simulated workloads.
Workload / metricNiu v0.2.4New API 45fbb14LiteLLM Proxy v1.104.0
c = 64 throughput (/v1/chat/completions)3,238.7 RPS

p50: 18.94 ms · p99: 31.54 ms

865.6 RPS (peak)

p50: 71.15 ms · p99: 135.73 ms

302.2 RPS

p50: 193.26 ms · p99: 338.74 ms

Anthropic /v1/messages (c = 64)2,518.8 RPS (p99: 60.61 ms)136.2 RPS (p99: 1,475.53 ms)232.2 RPS (p99: 397.88 ms)
Concurrent streaming throughput (c = 16)235.9 streams/s

9,436 tokens/s · Stream p50: 62.17 ms

100.9 streams/s

4,036 tokens/s · Stream p50: 150.33 ms

83.0 streams/s

3,320 tokens/s · Stream p50: 192.65 ms

Concurrent Inter-Token Latency (ITL p50, c = 16)1.34 ms3.55 ms (2.65x slower)4.62 ms (3.45x slower)
16 agents × 30 turns (codex /v1/chat/completions)1,686.6 ms wall

Turn p50: 54.05 ms · Turn p99: 72.50 ms

4,891.9 ms wall

Turn p50: 132.79 ms · Turn p99: 510.17 ms

5,803.9 ms wall

Turn p50: 180.75 ms · Turn p99: 328.23 ms

16 agents × 30 turns (claude_code /v1/messages)1,746.0 ms (turn p50: 55.02 ms)4,864.9 ms (turn p50: 141.96 ms)3,353.3 ms (turn p50: 103.01 ms)
Idle resident memory (RSS)18.16 MB37.42 MB (2.06x Niu)158.00 MB (8.70x Niu)
Peak resident memory under c = 64 load (RSS)26.40 MB98.50 MB (3.73x Niu)194.60 MB (7.37x Niu)

Different configurations: Niu used PostgreSQL admission and batched completion; New API used token caching and batched logs; LiteLLM used an in-memory master key without database spend logs. PostgreSQL synchronous_commit was off.

At a glance

Documentation reviewed October 30, 2026. This is a scope comparison, not a benchmark.
CapabilityNiuLiteLLMOpenRouter
From experimentation to ongoing operationProvider management, company/workspace/key budgets, request accounting and text/video generation managementSelf-hosted Proxy and Python SDK with virtual keys, spend tracking and an admin UIHosted model catalog, Provider routing and API-key limits
Video generation managementCreate and track supported video jobs, restore saved inputs and history, and preview/download available results with workspace-key authorizationSupported video endpoints depend on the configured model and ProviderHosted video APIs and video logs; model availability depends on its catalog
Application keysWorkspace keys with model grants, expiry, revocation and rotationVirtual keys with model access, budgets and expiryAPI keys with expiry and management APIs
Spending controlsCompany funds plus independent workspace/key caps; outstanding reservations countKey, user and team budgets; configurable budget durationUSD key limit; optional daily/weekly/monthly reset
PricingCustomer tariffs are separate from Provider offers; unresolved charges stay unknownModel cost tracking with configurable pricingCatalog charges paid with credits; BYOK is also supported
Request historyPostgreSQL records: model, key, status, reported tokens, timing and customer chargeSpend logs and configurable logging integrationsGeneration logs: model, Provider, key, usage, cost and timing
Inspecting retriesEach recorded attempt remains distinguishable from the requestRetry and fallback configuration; logging depends on configured integrationsUpstream Requests tab and Provider response waterfall
Chat endpointPOST /v1/chat/completionsPOST /v1/chat/completionsPOST /api/v1/chat/completions
Model namesAliases mapped to configured upstream modelsModel aliases in model_list map to upstream deploymentsCatalog model slugs
Upstream credentialsProvider businesses with separate credentials and model mappingsProvider credentials configured per deploymentOpenRouter credits or your Provider keys (BYOK)
RoutingConfigured pools with priorities and weightsLoad balancing across deployments with configurable strategiesProvider order; price, latency or throughput sorting
Retries and fallbacksBounded Chat failover after a qualified OpenRouter 401; no generic replay of uncertain requestsConfigurable retries, cooldowns, timeouts and fallbacksProvider fallbacks; allow_fallbacks can disable them
Function toolsOpt-in route support; the caller executes requested toolsTool calling for supported models; caller executes toolsRoutes to tool-capable Providers; caller handles execution
Where it runsYour own gateway deploymentSelf-hosted Proxy or Python SDK in your applicationOpenRouter-hosted service
DatabasePostgreSQL is requiredPostgreSQL required for Proxy virtual-key managementNo gateway database to operate
Source codePublic core under MITOpen-source core; review separate enterprise licensing termsHosted service; client SDKs are public

Go deeper

Two comparisons. Different tradeoffs.