> For the complete documentation index, see [llms.txt](https://docs.402gate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.402gate.com/core-protocol/autonomous-ai-payments.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
