A million tokens of repository context can cost $0.70 to read fresh or $0.035 to read from cache on the same Sonnet route. If you're estimating the cost of a coding session, start by finding out which read you paid for.
I maintain ClipRelay AI, the paid gateway in these examples. The 65% figure compares our Sonnet 5.5 token rates with the reference rates in our own catalog. The Codex example uses a different model and comes out to 75%. Neither percentage predicts how much you'll save over a subscription.
Price the same trace twice
USD per million tokens, December 6, 2026. In the public price feed, look under data.models for the exact ID. The columns correspond to input, cachedInput, cacheWrite and output. The reference rows use the official field. Check your direct-provider agreement if you have negotiated rates.
| Model ID | Rate card | Fresh input | Cache read | Cache write | Output |
|---|---|---|---|---|---|
claude-sonnet-5-5 |
Reference | 2.00 | 0.100 | 2.500 | 10.00 |
claude-sonnet-5-5 |
ClipRelay | 0.70 | 0.035 | 0.875 | 3.50 |
gpt-6.2-sol |
Reference | 2.00 | 0.100 | 2.500 | 10.00 |
gpt-6.2-sol |
ClipRelay | 0.50 | 0.025 | 0.625 | 2.50 |
Take a hypothetical Sonnet trace with 100k fresh input, 800k cache reads, 100k cache writes and 40k output. Count each token once. The reference subtotal is 0.20 + 0.08 + 0.25 + 0.40 = $0.93. Ours is 0.07 + 0.028 + 0.0875 + 0.14 = $0.3255. That's 1 − 0.3255 / 0.93 = 65%. Each Sol rate is one quarter of its reference rate. Use only the buckets actually reported for your route. A listed cache price doesn't guarantee a cache hit.
Claude Code
Start with the CLI installed and a funded ClipRelay API key in CLIPRELAY_API_KEY, supplied by your shell or secret manager. Use a fresh Bash session without conflicting provider or auth overrides. These two lines affect that session.
export ANTHROPIC_BASE_URL="https://cliprelayai.com"
export ANTHROPIC_API_KEY="${CLIPRELAY_API_KEY:?Set a ClipRelay key first}"
Run claude --model claude-sonnet-5-5 and select API-key billing if prompted. Keep the base at the origin. Claude Code appends /v1/messages for Anthropic-format turns, including streaming and tool use, and /v1/messages/count_tokens for input estimates. A preflight count can't tell you the final output length or cache split.
Codex CLI
Export the same key variable to the CLI process. Merge these two top-level lines into ~/.codex/config.toml above any table headers. Replace an existing model_provider setting and avoid duplicate provider definitions. Save the old setting so you can switch back.
model_provider = "cliprelay"
model_providers.cliprelay = { name = "ClipRelay", base_url = "https://cliprelayai.com/v1", env_key = "CLIPRELAY_API_KEY", wire_api = "responses" }
Run codex -m gpt-6.2-sol. This provider uses POST /v1/responses. A successful Chat Completions request alone won't verify that path.
Check one turn before switching a repo
Both configurations send prompts and any included source code through ClipRelay and an upstream provider. In an empty directory, ask for a one-line reply. Match the model and usage to the gateway's request history. Then try one read-only tool call. If the model is different or the request is missing, check active profiles and auth before continuing. These are configuration examples, not a paid compatibility test.
The gateway has a $0 monthly fee, a $5 minimum top-up and a non-expiring balance. Existing subscriptions bill separately. See agent setup for client settings and the calculator to budget a month of usage.
Top comments (0)