A 17-line Python script reveals how much your LLM gateway marks up token prices
LLM gateways simplify multi-vendor AI access by routing requests through a single API endpoint, but their per-token pricing relative to direct vendor rates is rarely compared in one place. A developer has published a short Python script that queries a gateway's models endpoint, applies a user-defined input/output token mix, and calculates the effective cost against published vendor list prices. When tested on August 14, 2026, the script found one gateway charging roughly 15% below list price for both GPT and Claude Sonnet models. For gateways that do not expose pricing via their API, the author recommends dividing last month's invoice by logged token counts to derive a real effective rate. The piece also cautions users to verify gateway compatibility with streaming, tool calls, and usage reporting before assuming a simple base URL swap is sufficient.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in