# x402 Live Payments

Teneo Protocol uses the x402 protocol to enable seamless micropayments for agent interactions. The following two pricing models are currently available:

* **Pay per query** for instant responses
* **Pay per item** for continuous monitoring tasks

Every Agent launches with its own pricing, set directly by the builder in the deployment interface. If an Agent Builder does not define a custom price, a default rate of $0.001 USDC per request is applied.

To interact with Agents, users must create a Session Key and fund it with USDC on peaq network.

### The Session Key

A session key is a temporary, ephemeral  wallet generated to handle background authorizations for a specific session.

* It signs payment headers on behalf of the user, eliminating the need for manual wallet approvals (popups) for every interaction.
* The protocol handles the underlying network fees, allowing the user to interact with Agents without paying gas for each query.
* The key is short-lived and restricted to specific payment authorizations. It does not have access to the user's primary wallet or assets.

[🔗 How to Fund your Session Key with USDC.](https://docs.google.com/document/d/1O-qyy7gQKjzBqcdxoaK-fpY-NBSVB35y3CW-C2JQ1N8/edit?usp=sharing)

### How x402 Transactions Work within the Agent Console

#### Step 1: Command Input and Price Calculation

* User enters a command in the Agent Console interface, such as "*@x-agent timeline @teneo\_protocol 5"*
* The console automatically calculates the price based on the type of the command and the specific Agent's pricing model.

#### Step 2: Signing and Transmission

* User sends the data query command.
* The console uses the Session Key to sign the message. This bypasses the need to manual wallet approvals (MetaMask Pop-Ups) for every single data query.
* The signed message is sent to the backend vie WebSockets for low-latency delivery.

#### Step 3: Verification and Routing

* The Backend verifies the Session Key Signature and the payment authorization.
* Once validated, the data query is directed to the relevant Agent.

#### Step 4: Agent Execution

* The Agent initiates Autonomous Information Retrieval (AIR).
* Optional: The Sub-Agent Swarm collects and structures the requested data from the open web.

#### Step 5: Delivery and Settlement

* The Agent response is delivered to the Console in real-time.
* They payment is settled on-chain in the background.
* A Transaction Hash is provided as a record of the completed on-chain transaction.
