> For the complete documentation index, see [llms.txt](https://docs.onyx.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onyx.org/onyx-ai/ai-agent.md).

# AI Agent

## Onyx AI: Autonomous Blockchain Intelligence on the XCN Ledger

Onyx AI is a next-generation, blockchain-native autonomous agent engineered to interface directly with decentralized infrastructure on the XCN Ledger. It combines on-chain execution capabilities with off-chain artificial intelligence reasoning, enabling intelligent automation of complex tasks across decentralized finance (DeFi), token management, and cross-chain operations. This hybrid agent is designed to operate with programmable autonomy, execute smart contract interactions, and respond to user prompts with contextual awareness and transaction precision.

At its core, Onyx AI functions as a self-directed, modular smart agent deployed natively on the XCN Ledger, leveraging XCN as the network fee asset for computation, execution, and value transfer. XCN is required to purchase `Credits` that enable the user to utilize prompts with the Agent.

The agent is architected to bridge the gap between AI-driven logic systems and the deterministic nature of EVM-compatible smart contract environments. It operates under a permissionless framework but utilizes embedded security policies to ensure safe execution across trusted protocols and wallet environments. Where the product presents a gasless experience, network fees are sponsored or abstracted from the user rather than removed from the underlying blockchain transaction.

Onyx AI marks a pivotal shift in the evolution of decentralized automation. By tightly integrating artificial intelligence with blockchain-native execution, it enables a future where agents—not just humans—can reason, transact, and operate autonomously within secure, deterministic environments. With Onyx AI, intelligent on-chain automation becomes accessible, programmable, and trustless.


---

# 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.onyx.org/onyx-ai/ai-agent.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.
