# Autonomous AI Payments

### **Overview**

The **Autonomous AI Payments** layer allows **AI agents and bots** to act as self-paying entities capable of purchasing, verifying, and accessing digital resources without human assistance.

Each agent holds a **non-custodial wallet** that interacts directly with 402Gate endpoints.\
When an AI model requests data or an API, it automatically receives a `402 Payment Required` response, processes the payment, verifies on-chain proof, and continues its operation **autonomously**.

#### **Example Flow**

1. AI agent requests API `/api/market-feed`
2. Receives `402 Payment Required` → parses payment info
3. Executes transaction via `agent.wallet.sendTransaction()`
4. Resends request with `Payment-Proof` header
5. Server validates proof → returns real data instantly

This loop runs continuously, allowing software to act economically buying data, paying for compute, or accessing resources automatically.

#### **Applications**

* Trading bots buying real-time market feeds.
* AI systems accessing external data via paid APIs.
* Autonomous agents running self-funded tasks in Web3 environments.

#### **Key Features**

* **Machine-to-Machine Transactions**\
  Enables bots and AI models to interact economically with APIs.
* **On-Chain Proof-of-Payment**\
  Verifies each transaction trustlessly using Solana RPC.
* **Autonomous Wallet Management**\
  Agents can top-up, delegate, or manage balances automatically.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.402gate.com/core-protocol/autonomous-ai-payments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
