

Every time you send a prompt to an artificial intelligence model or query a metered application programming interface (API), you leave behind a digital paper trail. Your API key points directly to an account, that account links to a payment method, and every single question or instruction joins a permanent record attached to both. Over time, service providers can stitch years of your digital interactions into a single, comprehensive profile.
Prompts are intensely personal. People turn to AI models to seek guidance on health concerns, financial planning, creative projects, and personal doubts. Under the conventional billing model, leveraging modern technology requires handing a running transcript of your thoughts directly to whichever entity holds your billing relationship. Until now, the alternatives were far from ideal: you could pay per request directly onchain—which is notoriously slow, expensive, and completely traceable by anyone—or you could blindly trust a centralized middleman to respect your privacy.
Enter zkAPI, a groundbreaking solution designed to let users pay for metered APIs completely anonymously. Built by the Open Anonymity Project in collaboration with the Ethereum Foundation and operating live on the Ethereum Mainnet today, zkAPI fundamentally separates payment from identity.
At its heart, zkAPI solves a classic cryptographic challenge: how can a service provider verify that you have paid for a service without ever learning who you are, which deposit you used, or how your sessions connect to one another?
The process begins when you deposit credits—such as Ether or stablecoins like USDC—into a vault smart contract on Ethereum in a single ordinary transaction. From that moment onward, your balance exists purely as a private note: digital cash that only you can control, and which no observer can trace back to your original deposit.
When you want to authorise spending, lightweight software running locally on your machine generates a compact zero-knowledge proof. This cryptographic proof demonstrates that a valid, funded note covers your anticipated spend and that the note has not been spent previously.
Two powerful cryptographic pillars make this system secure and private:
The architecture of zkAPI cleanly separates the payment path from the conversation path, ensuring that the server handling money never sees your content, and the provider fulfilling your requests never learns your billing identity.
This spending cap mechanism acts as a secure reservation. Because the system utilizes signed usage receipts, neither side can retroactively tamper with the bill, and a single authorisation can cover an entire interactive session rather than requiring an individual proof for every single request.
For developers seeking simpler setups, zkAPI also provides a streamlined proxy mode where the zkAPI server relays requests directly to the provider. While easier to operate, this mode allows the relay to observe traffic, making the runtime-key mode the gold standard for ultimate privacy.
Under the hood, zkAPI proves spends using Groth16 on the BN254 curve, hashes commitments and nullifiers with Poseidon, and relies on Ethereum vault contracts to ensure your ability to exit or close your balance never depends on the continuous honesty of any single server.
While AI inference represents the most urgent frontier because prompts are sensitive and traditional billing trails tie every query directly to an individual, the exact same client and smart contracts can frontcharge any service that charges per use.
While zkAPI offers revolutionary privacy safeguards, it is important to understand its boundaries, particularly regarding network anonymity and content leakage.
On the network layer, a gateway can potentially correlate request patterns if a user continuously sends requests to zkAPI from a stable, residential IP address. Users seeking maximum operational security often route their requests through tools like Tor, employing a fresh network circuit for each separate session.
On the content layer, individual sessions can sometimes be re-linked by inference providers if a user repeatedly exposes distinctive personal details, unique writing styles, reused conversation history, or specific proprietary documents. Shared prompt contents can inadvertently act as behavioural fingerprints. Mitigating this privacy-utility tradeoff often involves leveraging local models or Trusted Execution Environments (TEEs) to synthesise requests on top of shared memory rather than relying on manual typing.
zkAPI represents a massive leap forward for decentralized privacy, transforming a theoretical design by researchers Davide Crapis and Vitalik Buterin into fully functioning production software.
Your funds remain entirely under your control: because the vault is a transparent smart contract on Ethereum rather than a corporate bank account, you can close your balance and withdraw your assets onchain at any time, even if every zkAPI server were to vanish. Best of all, your tools remain completely unchanged—the local client exposes standard OpenAI and Ollama APIs directly on your own machine, allowing existing applications, code editors, and chat clients to work seamlessly by simply pointing them to localhost.
Explore the GitHub repository to run your own local client and server, interact with the live ZkApiVault holding USDC credits on Ethereum Mainnet, or test deployments on Sepolia to experience the future of private, unlinked API usage today.
Disclaimer: This article is provided for informational purposes only, mistakes may be made, and it's not offered or intended to be used as legal, tax, investment, financial, or any other advice.
