Skip to main content
This page follows one request from start to finish: a user message, the tool calls it triggers, the simulation step, and the wallet signature. MyCoinDex, a fictional crypto exchange, is the running example. For the component view of how an App and the Runtime fit together, see Architecture.

1. Your APIs

MyCoinDex exposes standard HTTP endpoints. Aomi does not modify them.

2. APIs Become AI Tools

Aomi wraps each endpoint as a tool, a typed function the LLM can invoke. Each tool has a name, description, and typed parameters. When a user asks “What’s ETH trading at?”, the model calls GetTokenPrice with { symbol: "ETH" }. The tool hits /prices/eth, returns the result, and the model composes a response. Tools can execute concurrently.

3. Configuring the Assistant

Preamble

The system prompt that shapes personality and rules:

Model Selection

Models can be changed at runtime. No redeployment needed.

RAG Document Store (Optional)

If MyCoinDex has documentation, FAQs, or knowledge base articles, Aomi ingests them into a vector store for the assistant to search.

4. Deployed as an App

Each app is fully isolated.

5. API Key and Authentication

MyCoinDex receives an API key scoped to their app:

6. The Request Flow

Step by Step

  1. User sends a message via the widget or headless integration.
  2. Frontend sends HTTP POST to /api/chat?app=mycoindex with the API key.
  3. Backend validates the API key and loads the session.
  4. Backend sends message + history + tools to the selected LLM.
  5. LLM decides to call tools and requests GetPortfolio and GetTokenPrice.
  6. Backend executes tool calls against MyCoinDex’s APIs.
  7. Tool results go back to the LLM for interpretation.
  8. LLM streams its response, and each text chunk forwards as an SSE event.
  9. Frontend renders incrementally.
  10. Complete event signals the response is finished.

SSE Stream Format

7. When a Tool Produces a Transaction

The flow above reads data. A write follows the same path until the tool builds a transaction. Then the safety steps take over. A tool never holds a key and never signs. It returns a transaction for the Runtime to simulate and the user’s wallet to sign.
  1. The model calls a write tool, for example ExecuteTrade.
  2. The tool builds the transaction parameters and returns them. It does not sign.
  3. The Runtime simulates the transaction on a fork of the live network.
  4. The user sees the exact token changes, gas, and contract calls. This is the simulate step.
  5. If the user approves, the wallet signs locally and the transaction is submitted. If the user rejects, nothing is sent.
For the safety properties of this flow, see Security. For the simulation internals, see the Simulation Reference.

What You Get

Next Steps

Last modified on July 2, 2026