CodeGateway Real Cost & Reliability Data: Reproducible Latency, Success Rate, and Billing Reconciliation
Every number on this page comes from reproducible scripts, not marketing estimates. Latency/success-rate probe: `scripts/probe-gateway-metrics.py`. Billing reconciliation: `docs/pricing/reconcile-vs-direct.mjs`. Dimensions we did not measure are explicitly labeled Not measured. This page does not constitute any SLA commitment. Formal SLA / status page is a separate project.
TL;DR
Dimension | Reading | Definition |
|---|---|---|
Token markup (vs official list price) | 1.07× (+7.0%) | Flat across tiers; base price = official price |
All-in (incl. 2% top-up fee + Stripe, amortized over a $10 top-up) | 1.1695× (+17.0%) | You pay ≈ $1.17 per $1 of official-equivalent usage |
$10 top-up charged to card | $10.93 (credit $10.00 + platform fee $0.20 + Stripe ≈ $0.73) | Script self-asserts |
Call success rate (test, n=15) | 15/15 = 100% | HTTP 2xx and parseable body |
Claude Code compatibility | Verified end-to-end (protocol probe + real CLI) |
|
Codex CLI compatibility | Not measured (known protocol tension, see below) |
|
Cursor CLI | Not supported (official CLI has no custom base-URL config) | — |
Latency P50/P95 / TTFT | No performance conclusion yet (client network floor pollution; see “How to read latency”) | Method is in-repo; will re-run on a clean network path |
1. Billing reconciliation: what you actually pay
1.1 Three fee layers (code-level source of truth)
Layer | Value | Source |
|---|---|---|
Token billing | base price × 1.07 |
|
Top-up service fee | face value 2% |
|
Stripe gross-up |
| Same file; platform fronts Stripe and folds it into what you pay |
If we only said “1.07×”, we would understate your all-in cost by ~10 points. We chose to show the top-up side too.
1.2 $10 top-up example
credit $10.00 (value you receive)
platformFee $ 0.20 (2% of face)
stripeFee $ 0.73 (ceil((1020+30)/0.961) − 1020)
─────────────────────
charged to card $10.93 ⇒ $1.0930 paid per $1 of creditRecompute: node docs/pricing/reconcile-vs-direct.mjs (the script self-asserts; mismatch exits 1).
1.3 All-in multiplier for three representative workloads
Workload | Official direct | CG token billing | token-only | All-in (amortized $10 top-up) |
|---|---|---|---|---|
W1 Claude Code medium session (40 turns, system/tools on 5-min cache) | $4.90 | $5.24 | 1.0700× | 1.1695× |
W2 Long-form generation (30K in / 8K out, no cache) | $0.14 | $0.15 | 1.0700× | 1.1695× |
W3 Batch classification (20K × 800in/50out) | $21.00 | $22.47 | 1.0700× | 1.1695× |
Worked example (W1):
Official = 0.6M×$2 + 4.0M×$0.10 (cacheRead) + 1.2M×$2.50 (cacheWrite) + 0.03M×$10 = $4.90
CG base prices match official (verified after the 2026-10-15 price fix); ×1.07 = $5.24
All-in = 1.07 × 1.093 ($10 top-up amortization) = 1.1695
Batch caveat: CG has no batch tier today. If you would have used the official Batch API (50% off) anyway, W3 vs official Batch direct is about 2.34× all-in — that comparison does not apply to interactive work (W1/W2). Micro-amount footnote: if you top up exactly one workload, the fixed $0.30 Stripe fee dominates tiny amounts. In practice users use the $10 tier or free credit; the main table uses amortized economics.
1.4 Historical skew (fixed; kept for the record)
claude-sonnet-5-5 cacheRead was billed at $0.20/MTok while official is $0.10 ⇒ cache-heavy workloads briefly reached +26.5% all-in. Fixed 2026-10-14 and verified in production (GET /v1/pricing: cache_read_per_mtok=0.1). All workloads now uniformly +17.0%.
2. Reliability measurements: success rate first, latency with caution
2.1 Measurement definition (read this first)
Environment:
https://api-test.codegateway.dev(test)Window: 2026-10-14T08:17:21Z → 08:22:40Z (5m 19s)
Definition: client-visible end-to-end milliseconds, cold connections (new TLS per request), including this host’s network path
Re-run: see `docs/agent-cli-integration/metrics/README.md`
2.2 How to read latency (honest disclosure)
Network floor from the same session:
Control | n | P50 | Meaning |
|---|---|---|---|
| 3 | 4974 ms | no auth, no upstream |
| 3 | 1436 ms | this host’s path floor |
The floor from this machine to the public internet is on the order of 1.4–5 seconds. Gateway latency in the table below is dominated by the client path and must not be read as gateway server performance.
Therefore this page does not use absolute latency as a performance claim. The probe and floor-correction method are in the repo. We will publish comparable latency numbers only after a prod re-run from a clean network path. Until then, “we are faster” should not appear anywhere — including our own marketing.
2.3 Success rate (usable)
Surface | n | Success | Rate |
|---|---|---|---|
Non-streaming | 10/model × 2 models | 20/20 | 100% |
Streaming TTFT ( | 5/model × 2 models | 10/10 | 100% |
Success = HTTP 2xx and parseable body (non-streaming needs choices[0]; streaming needs ≥1 non-empty SSE delta).
Sample size and window as above. This is not a long-term SLA — it is a reproducible reading we can show in public docs.
2.4 Streaming TTFT (archived readings; not a conclusion)
Model | n | TTFT P50 | TTFT P95 | Total duration P50 |
|---|---|---|---|---|
| 5 | 4891 ms | 8170 ms | 6289 ms |
| 5 | 4880 ms | 9331 ms | 6140 ms |
TTFT = first non-empty SSE data: chunk (content or reasoning_content). Also polluted by the network floor — no performance conclusion.
3. Agent CLI compatibility
CLI | Protocol surface | Status | Evidence |
|---|---|---|---|
Claude Code |
| ✅ Verified | Protocol probe 3/3 HTTP 200 + real CLI: |
Codex CLI |
| ⚠️ Not measured | Probe shows standard Responses body rejected; response is chat.completion-shaped. Real CLI not end-to-end verified. We do not claim compatibility |
Cursor CLI | — | ⛔ Not supported | Official CLI auth is Cursor-account only; no base-URL / custom provider config |
Compatibility matrix and per-CLI setup: `docs/agent-cli-integration/` (drafts + tools for Cursor / Codex / Gemini CLI, etc.).
4. Reproducible integration examples
4.1 One-shot probe (verify your path)
# API key required (see 4.2)
export ANTHROPIC_BASE_URL=https://api.codegateway.dev
export ANTHROPIC_AUTH_TOKEN=<your CodeGateway key>
# Protocol self-check
curl -sS "$ANTHROPIC_BASE_URL/v1/messages" \
-H "x-api-key: $ANTHROPIC_AUTH_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-4-6","max_tokens":16,"messages":[{"role":"user","content":"ok"}]}'4.2 No official key / don’t want a foreign card?
Register on CodeGateway and get a key. Alipay and other local methods are supported (no international credit card required). free credit (current amount on the signup/pricing page) is enough to run the probe above.
4.3 Troubleshooting cross-links
Connection timeouts: Claude Code connection timeout solutions
Billing / quota questions: use
GET /v1/pricing+ §1 on this page; do not trust third-party cached pricesCLI setup: `docs/agent-cli-integration/`
5. What we did not measure (explicit list)
Dimension | Status |
|---|---|
prod latency / success rate | Not measured (probe issues real billed calls; current egress floor is too high) |
Codex CLI real end-to-end | Not measured ( |
Production token mix (real in/out/cache ratios) | Not measured (billing recon uses defined representative scenarios) |
Long-term SLA / annual availability % | No commitment (status page is a sibling project) |
Cursor CLI | Not supported (product boundary, not a failure) |
6. Takeaways
Cost: token-side flat 1.07×; with top-up and payment fees fully counted, you pay about 1.17× official list. A $10 top-up yields $10.00 credit and charges $10.93 to the card. We publish the arithmetic and the scripts.
Reliability: short-window success rate 15/15. Latency numbers are not concluded because of the client network floor — methodology is public; we will update after re-measurement.
Compatibility: Claude Code verified; Codex CLI untested and unclaimed; Cursor unsupported.
Next: prod re-measurement from a clean network path, Codex CLI
/v1/responsesshape verification, production token-mix measurement.
When numbers change, this page changes with them. Scripts are traceable in git history.