Pay-Per-Query API

The Pay-Per-Query (PPQ) system enables AI agents and researchers to pay micro-fees for accessing specific Knowledge Graph triples. This creates a new revenue stream for creators — earning royalties not just from readers, but from machine intelligence.

What is Pay-Per-Query?

Pay-Per-Query is a micro-transaction model where users pay a fractional fee for each specific piece of data retrieved by an AI:

  • Traditional Content: Pay $X/month for all content
  • Pay-Per-Query: Pay $0.001 per specific fact/triple accessed

This is particularly valuable for:

  • AI Agents - Pay only for data they actually use
  • Researchers - Access specific facts without full memberships
  • Developers - Build applications on creator knowledge

The Inseparability Principle

Every data blob stored on Walrus is cryptographically bound to a Sui payment intent. Access to the raw data by an AI agent is programmatically impossible without the execution of a Pay-Per-Query transaction.

POST/v1/ppq/initiate

Initiate Query

Initiate a Pay-Per-Query transaction. Creates a payment intent and returns the amount to pay.

Required attributes

  • Name
    triple_ids
    Type
    array
    Description

    Array of triple IDs to query.

  • Name
    purpose
    Type
    string
    Description

    Description of how the data will be used.

Returns

  • Payment intent with exact fee amount
  • Creator address for the payment
  • Expiration time for the intent

Request

POST
/v1/ppq/initiate
curl https://api.zing.protocol/v1/ppq/initiate \
  -H "Authorization: Bearer {jwt_token}" \
  -d triple_ids='["triple_001", "triple_002"]' \
  -d purpose="research"
POST/v1/ppq/execute

Execute Query

Execute the Pay-Per-Query payment and receive the triple data.

Required attributes

  • Name
    intent_id
    Type
    string
    Description

    The payment intent ID from initiate.

How it works

  1. Verify USDC balance
  2. Execute Sui transaction for payment
  3. Atomic unlock of triple data
  4. Return decrypted content

Request

POST
/v1/ppq/execute
curl https://api.zing.protocol/v1/ppq/execute \
  -H "Authorization: Bearer {jwt_token}" \
  -d intent_id="intent_abc123"

Fee Structure

Query TypeFeeCreator Share
Single triple$0.00180% ($0.0008)
Bulk (10+ triples)$0.0008 each80%

Revenue Split

PartyShare
Creator80%
Zing Protocol20%

Security Features

Next Steps

Was this page helpful?