The landscape of artificial intelligence usage has long carried an invisible cost: privacy. Every prompt, every query, and every automated interaction with an AI model is inextricably tied to a user’s identity through traditional billing mechanisms. Your API key maps directly to a specific account, which in turn links to a credit card or institutional payment method, creating an exhaustive, permanent record of your personal inquiries, professional challenges, and intellectual pursuits.
Addressing this fundamental privacy flaw in modern software architecture, the Open Anonymity Project, in collaboration with the Ethereum Foundation, has officially launched zkAPI on the Ethereum Mainnet. Based on a design originally published on Ethereum Research by Davide Crapis and Vitalik Buterin, zkAPI allows users to pay for metered application programming interfaces completely anonymously. By leveraging zero-knowledge proofs, the protocol decouples financial transactions from user identities, ensuring that neither service providers nor payment layers can link a user’s spending habits to their real-world profile.
The Surveillance Problem of Modern API Usage
In the current digital ecosystem, privacy is systematically eroded by standard billing relationships. When individuals interact with large language models or other metered services, they frequently explore sensitive topics involving their health, personal finances, professional doubts, or creative ambitions. Under prevailing commercial models, these deeply personal prompts are bundled together with persistent billing identifiers. Over months and years, providers accumulate a comprehensive, longitudinal profile of a user’s inner thoughts, queries, and behaviors.
Historically, the alternatives available to privacy-conscious users have been inadequate. Attempting to pay for individual requests directly on a public blockchain is notoriously slow, financially expensive due to transaction fees, and entirely traceable by anyone monitoring the ledger. Alternatively, users could rely on centralized intermediaries, forcing them to trust third parties not to harvest, monetize, or leak their sensitive usage data. zkAPI introduces a cryptographic solution to this dilemma, establishing a secure framework where payments can be verified and settled without ever exposing the underlying identity of the consumer.
Decoupling Payment from Identity
The core innovation behind zkAPI is the separation of payment mechanics from user identity. The process begins when a user deposits digital assets, such as Ethereum or stablecoins like USDC, into a dedicated vault smart contract deployed on the Ethereum blockchain. This requires a standard, ordinary onchain transaction. Once the deposit is completed, the user’s balance is transformed into a private note—essentially a form of digital cash that only the holder can spend and that observers cannot trace back to the initial deposit address.
To authorize subsequent spending without revealing identity, software running locally on the user’s machine generates a succinct zero-knowledge proof. This mathematical proof attests to two critical facts: that a valid, funded note covers the cost of the current API spend, and that the specific note has not been expended previously. A single zero-knowledge proof can be structured to cover either a single isolated request or an entire continuous session of interactions.
The receiving server can mathematically verify the truth of this statement without learning which specific note, which initial deposit, or which human being initiated the request. Consequently, at the payment processing layer, individual requests remain completely unlinkable to the user’s identity, as well as to one another.
Two foundational pillars of cryptography ensure the security and privacy of this architecture. First, user deposits are maintained as commitments within a Merkle tree data structure. This allows a zero-knowledge proof to demonstrate that a user’s spending note belongs to the set of valid deposits without pointing to any particular entry. Second, every time a user authorizes a spend, the system publishes a unique cryptographic nullifier—a one-way serial number derived from the secret components of the note.
While an honest user operating within their allocated balance remains entirely anonymous, any attempt to double-spend the same balance results in a duplicate nullifier being broadcast to the system. This collision immediately exposes the fraudulent attempt without revealing any other details about the user, preserving the integrity of the economic model.

Operational Dynamics and Trustlessness
The architecture of zkAPI carefully divides responsibilities between the payment verification layer and the content delivery layer. The server handling the financial settlement mechanisms never views the actual content or prompts of the user’s conversation. Conversely, the AI provider that processes the model inference and sees the conversation content never learns the billing identity or the funding source behind the cryptographic key used to pay for the service.
This separation relies on short-lived runtime keys and signed usage receipts. When a user initiates a session, a spending cap functions essentially as a cryptographic reservation. As the session progresses, the provider records the total usage associated with the temporary key in a signed receipt, and the system deducts that precise amount from the user’s private note. Neither the service provider nor the payment intermediary has the ability to alter or inflate the bill retroactively, and a single authorization covers an entire session rather than requiring computational proof generation for every individual API call.
For developers seeking simpler integrations, zkAPI also supports a streamlined proxy mode where a dedicated server relays requests directly to the AI provider. While this mode is easier to operate, the relay node necessarily observes network traffic. For maximum privacy, the runtime-key mode ensures that no payment intermediary ever gains visibility into the communication stream.
Under the hood, zkAPI utilizes Groth16 zero-knowledge proofs operating over the BN254 elliptic curve, leverages Poseidon hashing functions for commitments and nullifiers, and maintains notes within a Merkle tree depth of 32 levels. While the server verifies spend proofs off-chain to maintain high performance, the underlying Ethereum vault smart contract independently verifies identical proofs during deposit, closing, and emergency withdrawal phases. This guarantees that a user’s ability to exit the system and reclaim their funds never relies on the honesty or availability of the central server.
Practical Applications Across Metered Services
While AI inference represents the most immediate and pressing application due to the sensitive nature of language model prompts, the underlying client software and smart contracts can secure any digital service structured around usage-based pricing.
Blockchain infrastructure providers, for example, can utilize zkAPI to meter remote procedure call (RPC) queries without tying blockchain queries to specific funding sources or user accounts. Similarly, platforms offering image and video generation jobs can verify payment for intensive computational workloads without logging who paid for specific assets. Decentralized virtual private networks and bandwidth providers can meter data consumption and connection time while keeping customer identities completely shielded. Furthermore, autonomous machine-to-machine agents can utilize the system to pay for localized computational tasks and micro-services dynamically without needing a traditional corporate account or credit card.
Despite these advanced cryptographic guarantees, privacy remains multifaceted. zkAPI specifically conceals the economic link between the consumer and the service provider. However, external factors such as network metadata, including the user’s internet protocol address, remain visible to gateways unless mitigated by external privacy tools. Consequently, privacy-focused users frequently combine zkAPI with routing protocols like Tor to mask network-level identifiers, while content-level privacy continues to evolve alongside confidential computing technologies like trusted execution environments.
For AI providers and infrastructure operators, integrating zkAPI requires minimal friction. Providers accept cryptographic proofs in lieu of traditional API keys and settle signed usage receipts instead of maintaining complex database accounts, billing departments, and subscription management pipelines. Core business parameters such as pricing models, rate limits, and underlying server infrastructure remain entirely unchanged.
Current Availability
As privacy concerns surrounding artificial intelligence and digital surveillance continue to escalate across global industries, zkAPI offers a pragmatic cryptographic bridge between financial accountability and absolute personal anonymity. The protocol is live and fully operational on the Ethereum Mainnet, with open-source client tools and comprehensive developer documentation available for teams looking to integrate zero-knowledge billing into their applications. Developers can build local gateways and configure OpenAI-compatible applications to route through the system immediately, marking a significant milestone in the ongoing development of privacy-preserving web infrastructure.
