OlaiDocs
Open the desk

Guides

Ask a question

What a good question looks like, what the agent may do with it, and what comes back.

From the desk

Open /app. With no questions asked yet, the welcome card reads Your analyst is ready. over three steps: 1. Check the rulebook, one line of the rules in force with an Edit link that opens the Details drawer on the Rulebook tab; 2. Ask a question, with three example chips that fill the box for you; and 3. Approve or reject what Olai proposes.

The box at the bottom of the screen carries the placeholder "Ask Olai about a position or a market" and the button beside it reads Ask Olai. Ctrl-Enter, or Cmd-Enter on a Mac, sends it too. Sending is disabled while a question is already running, while Olai is stopped ("Olai is stopped. Resume it at the top of the screen before asking anything."), and while the service cannot be reached. During a session the button reads "Olai is working" and a line under it says "Reading the market and shopping for data, this can take a minute," with a running seconds count beside it, because a session takes a minute or more and a bare spinner would read as a hang.

Your question appears at the top of the thread under "You asked". Under it, every step Olai takes arrives as one plain sentence as it happens:

text
Olai searched the Bazaar for BNB wallet flows: 3 listings under $0.05
Olai priced a data call at $0.01 from api.nansen.ai
Olai paid api.nansen.ai $0.01 from the wallet
Settled on BNB Smart Chain, api.nansen.ai was paid $0.01
Olai read the market: BNBUSDT at ...

The settled line carries a BscScan link to the settlement hash, and every sentence has a The ledger line button that opens the raw record under it. None of these sentences is written by the screen: each one is a ledger line read back through packages/web/src/lib/describe.ts, so the conversation and the receipt cannot tell different stories. Show Olai's reasoning, under the steps, opens the raw model commentary for anyone who wants it.

The session ends with the proposal card, covered in Approve or reject. Earlier questions are in the left rail, headed Earlier questions, which becomes a dropdown of the same name on a narrow screen. These are the components under packages/web/src/components/conversation.

From the command line

bash
curl -X POST http://localhost:4000/api/ask \
  -H "Authorization: Bearer $OLAI_OWNER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"question":"Should I trim my BNB position before the weekend?"}'

The question is 1 to 2000 characters after trimming (askSchema in packages/agent/src/api/app.ts). Anything else comes back as a 400 naming the problem.

What Olai does with it

The brain gets seven tools and nothing else (packages/agent/src/brain/analyst.ts):

Tool Costs What it does
search_bazaar free Searches the B402 Bazaar. Returns at most eight results the Binance wallet can actually pay for, cheapest first. Buys nothing.
buy_data real money Pays one merchant over x402 and returns what it sends back. The rulebook is checked in code first.
read_ticker free Last price and the 24 hour move for one symbol.
read_order_book free Top of the book, up to 20 levels, to see how thin the market is.
read_klines free Recent candles for trend and volatility.
read_account free Balances and open positions on the sub-account.
propose free Ends the session with one proposal. Called exactly once, last.

There is no order tool in that list. The model cannot place an order, and it cannot raise its own spending cap: whatever maxUsdPrice it asks search_bazaar for is clamped to the rulebook's maxDataSpendUsdPerCall before the search runs.

What comes back

A session record:

json
{
  "id": "ol-3f0c...",
  "question": "Should I trim my BNB position before the weekend?",
  "createdAt": "2026-09-06T09:12:44.106Z",
  "status": "pending",
  "proposal": {
    "summary": "...",
    "reasoning": "...",
    "action": {
      "type": "order",
      "symbol": "BNBUSDT",
      "side": "SELL",
      "quoteUsd": 15,
      "orderType": "MARKET"
    },
    "confidence": 0.62,
    "dataUsed": [{ "url": "...", "costUsd": 0.01, "txHash": "0x..." }],
    "risks": ["..."]
  },
  "verdict": {
    "allowed": true,
    "requiresApproval": true,
    "effectiveMaxOrderUsd": 20,
    "reasons": ["This order is above $0.00, so the owner has to approve it."],
    "ruleIds": ["order.needs_approval"]
  }
}

status is one of:

Status Meaning
pending There is an order waiting for you.
refused The rulebook refused the proposal. Nothing to approve. Read verdict.reasons.
approved Olai proposed holding. Nothing to do, nothing to send.
rejected You said no.
executed The order was sent and came back filled, or, in a dry run, was recorded and not sent.
failed The exchange refused it or the call threw.

dataUsed is written by the model itself. It is not cross-checked against the ledger, so treat it as the model's account of what it bought and read the ledger for what actually happened. See Read the ledger.

Watching it think

GET /api/events is a server-sent event stream carrying the same commentary the dry-run script prints: thinking fragments, answer text, every tool call and every tool result. It opens with a ready event and sends a heartbeat comment every 15 seconds so a proxy does not close an idle stream. At most 16 streams may be open at once.

The desk reads this stream with fetch and a stream reader rather than EventSource, because EventSource cannot carry the Authorization header the owner's token needs (packages/web/src/lib/sse.ts). It is what Show Olai's reasoning opens.

The stream is commentary, not the record. Nothing is proven by it. The ledger is the record.

Questions that work

Ask about a position, a market on the allowed list, and a decision you would actually make:

  • "Should I trim my BNB position before the weekend?"
  • "Is there anything in the flows that argues against adding to ETH today?"
  • "What does the order book look like for BTCUSDT right now, and does it change the case for buying 20 dollars' worth?"

Asking about a market that is not in allowedSymbols is not an error. Olai will research it and propose something, and the rulebook will refuse the order with order.symbol_not_allowed before you are asked to approve anything.