An open-source tool called pxpipe exploits a peculiarity in Anthropic’s pricing model: images are billed by pixel size, not by their text content. Developer Steven Chong has built a local proxy for Claude Code that converts extensive text inputs into compact PNG images before they go to the Anthropic API – with the aim of significantly reducing the token bill.
How pxpipe works
According to the project description on GitHub, Anthropic charges a flat rate for a 1568-pixel-wide image, regardless of how much text it contains. For dense content like code, JSON, or terminal outputs, this allows for about 3.1 characters per image token, compared to around one character per text token in actual Claude Code traffic.
pxpipe acts as a local proxy between the Claude Code client and the Anthropic API. It intercepts requests to the /v1/messages endpoint and renders the extensive, repetitive parts of a request – system prompt, tool documentation, older chat history – as PNG pages before forwarding them. Current messages, recent conversation histories, and the model outputs themselves remain unaffected and are transmitted unchanged as text.
The savings in detail
According to the project, the total bill decreases on average by 59 to 70 percent, based on the actual production log of 13,709 requests. The lower value of 59 percent refers to the complete bill including the approximately 6,000 small requests that pxpipe leaves untouched; for the 7,756 actually compressed requests, costs decrease by 72 percent according to the repository. In a documented example with Claude Fable 5, session costs dropped from $42.21 to $6.06.
The method is not solely based on image size but follows a profitability threshold described in the repository: only content where converting to an image is actually worthwhile based on the measured characters-per-token values is compressed. Loosely written English prose, for example, becomes more expensive as an image rather than cheaper and thus remains as text.
Accuracy: Where there are issues
The method is explicitly lossy according to the project description. In a so-called needle-in-haystack test for reproducing exact 12-digit hexadecimal strings from rendered images, the Opus model achieved 0 out of 15 correct answers, while Fable 5 managed 13 out of 15. The documented failure mode is not a recognizable error but a “silent confabulation”: the model returns a plausible but incorrect value without indicating this. For information that must remain byte-accurate – IDs, hashes, secrets, exact numbers – the project therefore recommends keeping these as text.
By default, pxpipe only supports Claude Fable 5 and GPT 5.6. According to the evaluations documented in the repository, Opus 4.7 and 4.8 experience reading errors in about 7 percent of the rendered images; GPT 5.5 also performs worse with image content. Both models are therefore not automatically activated but can only be manually enabled via a configuration option. In benchmarks with new, previously unknown random numbers, Fable 5, on the other hand, achieves 100 percent accuracy in arithmetic tasks – both as text and as a rendered image.
Practical tests with SWE-bench
Beyond pure accuracy benchmarks, the project has also tested the impact on complete programming tasks. In a test run with ten tasks from the easier SWE-bench-Lite dataset, Claude Code solved 10 out of 10 tasks with and without pxpipe, with a reduction in request size of 65 percent. In 19 completed, more challenging pairs from SWE-bench Pro, 14 out of 19 tasks were solved with pxpipe compared to 15 out of 19 without compression, with a reduction in request size of 60 percent. The evaluations matched in 18 out of 19 cases; the only deviating case could be consistently reproduced according to the project through triple repetition and is classified as ordinary variation between individual agent runs, not as a result of image compression.
Not a completely new idea
The idea of passing text in compressed image form to AI models has a predecessor: DeepSeek has released a model called DeepSeek-OCR that compresses text documents via a 2D image representation. According to the associated technical paper, the model achieves a decoding accuracy of around 97 percent at a compression ratio of less than tenfold, while at a twentyfold ratio, it drops to about 60 percent.
The AI commentator Chubby (@kimmonismus) classified pxpipe on X accordingly: DeepSeek treated the problem as a model or architecture question, while pxpipe approached it as a pure infrastructure trick that exploits the fact that current models can already read images well enough. This makes the approach less elegant and more prone to loss, but still noteworthy.
Classification
pxpipe primarily highlights a gap in the current pricing model, not primarily a technical breakthrough: as long as image tokens are billed flatly by pixel size and not by informational content, this difference can be strategically exploited for dense, token-rich content like code. The project’s own benchmarks also openly document the limitations of the method – from the approximately 7 percent increased error rate in Opus models to the fundamental unsuitability for content that must remain byte-accurate. Whether the pricing structure of model providers changes in response to such tools remains to be seen.


