Skip to main content
Otto X brings the Otto AI agent swarm to the X Layer ecosystem. Same x402 thesis — pay per call, no API keys, payment IS the authentication — now settling on X Layer mainnet via OKX’s Onchain OS infrastructure. Base URL: https://xlayer.ottoai.services Chain: X Layer Mainnet (Chain ID: 196) Payment: Micro-payments on X Layer via the OKX Facilitator — pay service fees in USDT0, USDG, or USDC (see GET /tokens for the full token registry). Listed on OKX: Otto X is reachable from OKX’s Onchain OS at okx.ai/agents/2118. Discovery: Sister surface (overlapping agent catalog, different rail): x402 (USDC on Base/Solana). See Access Paths & Coverage for current counts and capability coverage.

How It Differs from x402.ottoai.services

Both deployments serve the same underlying agent intelligence. Otto X adds X Layer-native DeFi endpoints (swap quotes, token pricing, approvals) powered by OKX DEX Aggregator.

OKX Onchain OS Usage

Pricing Overview

X Layer DEX Endpoints

Market Intelligence

Data & Global Intelligence

Always-warm global data reads ported to X Layer (prices mirror the Base sibling). Each is a single worker-refreshed aggregate — no query params — that fail-closes (uncharged) rather than serve a cold read.

Equity Intelligence (ticker-parameterized, $0.003)

Write-through pay-per-call reads for licensed equity data (vendor-resolved tickers; no market-coverage claim) — each requires ?ticker=SYMBOL (e.g. ?ticker=AAPL). The OKX exact rail verifies payment before the handler runs and cancels settlement on any ≥ 400 response, so an unknown or failed ticker is uncharged.

Composed Recipes

Multi-source intelligence in a single paid call — each recipe fans out to several upstream legs and returns one composed artifact. A recipe refuses (unpaid) if its core leg returns no usable data; best-effort legs that can’t resolve are named as unavailable rather than fabricated. Browse the live catalog at GET /api/recipes (free) or the storefront at GET /recipes. GET /mega-report ($0.05, listed under Market Intelligence) is a composed briefing on the same pattern.

AI Tools

Trading Resources

Read-only data sourced directly from Otto X’s own libs — Zerion for portfolios, vaults.fyi for yield positions, DeFi Llama for yield markets, Hyperliquid info endpoint for perps data. Wallet-scoped reads default to your Otto X sub-wallet (resolved from your x402 payer); pass ?address=0x... to query any other EVM address.

Agentic Wallet V2 — Autonomous DeFi Execution

Otto X provisions a TEE-custodied sub-wallet for each x402 payer and executes swaps, bridges, and DeFi deposits on their behalf — all signed inside OKX’s TEE, no user-side key management.

Yield Watch

Allowlisted protocols: All four protocols × every chain in the table are reachable: each of those chains is in the gas-top-up + execution registry. (Lido is ETH staking on Ethereum, not a stablecoin venue.) principalAuth launch chains (USDC EIP-3009): Base, Arbitrum, Optimism, Ethereum, Polygon. Plus X Layer (USDT0). Other chains still work via the legacy 409 funds-required fallback — see below. On Ethereum, ops are declined during a base-fee spike (above ~25 gwei) rather than subsidizing it. Expansion requires mainnet validation of a full deposit→withdraw cycle before a new protocol is added.

Yield Copilot — POST /yield-copilot

One call deploys your idle stablecoin capital into yield:
  • What it does: reads your Otto X sub-wallet’s idle balance of the requested stablecoin, picks the lending venue — the highest current APY among the Otto-allowlisted lending protocols (Aave V3, Compound V3, Morpho) for that stablecoin on that chain, sourced from vaults.fyi (Base / Arbitrum / Optimism / Ethereum) with the DeFi Llama yields API as fallback (the apy_source field in the response says which was used) — and supplies it via the same path /auto-defi-invest uses. Accepted stablecoins are those in the allowlist for that chain (USDC, USDT, USDT0, USDG, USDC.e, DAI as applicable). Omit amount to deploy the entire idle balance; supply principalAuth to fund the sub-wallet in the same call — principalAuth funding currently supports USDC on Base/Arbitrum/Optimism/Ethereum/Polygon and USDT0 on X Layer, and its value must equal the deposit amount exactly.
  • Scope: Base, Arbitrum, Optimism, Ethereum, X Layer. (X Layer has no public APY feed yet, so on X Layer the response reports the venue with apy: null and points you to GET /yield-farming-active for the live rate. On Ethereum, the call is declined during a base-fee spike — above ~25 gwei — rather than subsidizing it.) If a stablecoin has several allowlisted venues on a chain and the APY feed is unavailable, Otto returns 503 APY_DATA_UNAVAILABLE rather than guessing — pick the venue yourself via /auto-defi-invest.
  • The response is the artifact: before (idle amount, 0% APY) → after (venue, APY, illustrative annualized + monthly yield at the current rate) → economics ($0.05 Otto fee, APY delta) → custody (your payer-bound sub-wallet, withdraw endpoints) → selection (why this venue, APY source, TVL, pool id) → tx_hashes → a not_investment_advice disclaimer.
  • What Otto provides: automation + transparency + non-custody + a $0.05 fee — not “earning power” or guaranteed returns. APYs float; deployed capital carries smart-contract, liquidity, and market risk. Otto never pools or rehypothecates user funds; withdraw the position anytime via POST /auto-defi-withdraw, or sweep the whole sub-wallet via POST /auto-withdraw.

Yield Watch — POST /yield-watch (notify) / POST /yield-watch (auto) / DELETE /yield-watch / GET /yield-watch / GET /yield-watch/audit

Tier 3 of the yield ladder: instead of polling /yield-farming-active yourself, register once and let Otto watch your positions and either notify you via Telegram when there’s a better venue, or auto-rebalance under a 30-day signed delegation. Two modes — the same endpoint, the body distinguishes: Notify mode (no on-chain delegation, no spending limits — Otto just sends a Telegram receipt when a sustained APY gap opens, including the copy-pasteable two-call switch):
Auto mode (signed EIP-712 delegation — Otto will rebalance Aave↔Compound on your behalf, capped by maxMoves over 30 days and maxPrincipalRaw per move, every move audited + receipted to Telegram):
Signing the delegation. The client signs an EIP-712 YieldDelegation message over a fixed domain (OttoXYieldWatch v1 — a pure off-chain authority bound to the wallet, sub-wallet, and nonce). For the full domain, typed-data structure, and a copy-paste signTypedData recipe (plus the RevokeYieldDelegation flow), see the Otto X repo. Server verifies the signature with viem’s recoverTypedDataAddress and binds it to the registered wallet. The delegation is atomically claimed via a single-statement CAS on next_nonce — concurrent registrations from the same wallet can’t replay each other, and a revocation always bumps the nonce so a stale signed message can’t replay after revoke. Auto-mode revocation signs RevokeYieldDelegation with the current nonce; notify mode just sends a DELETE (chat-id ownership is the auth). Guardrails (auto mode):
  • Allowlist: Aave V3 and Compound V3 only for v1. Morpho is rejected at registration (vault-address coupling lands in v1.1).
  • TVL floor + APY staleness: an alt protocol must have ≥ $10M TVL and an APY data point ≤ 2h old before it can win a move.
  • Hysteresis state machine: the alt must beat the current venue by hysteresisPctBps sustained for hysteresisHours straight (the worker tracks per-position observations; a regression resets the window).
  • Throttle: at most one move per position per throttleHours window (default 72h) — bounds gas + Otto-fee spend.
  • maxMoves: a hard cap over the 30-day delegation window. After the cap, the worker refuses further moves on that wallet.
  • maxPrincipalRaw: a per-move notional cap in raw token units (e.g. "5000000" = $5 USDC at 6 decimals). "0" = no cap. Cap is bound to the LIVE position size at lock time, so a mid-window top-up over the cap is refused.
  • Pre-broadcast resolver guards: both the current and the best-alt market must resolve cleanly via OKX, and must point at the SAME canonical token address (no USDC → USDC.e routing, no surprise asset substitution). Refusals at this stage never pay the audit cost.
  • Post-broadcast verification: every leg (withdraw + invest) is followed by assertReceiptsConfirmed — a hard check that the broadcast tx hash actually landed on-chain. Defends against the OKX silent-drop bug pattern ({ok:true, txHash} returned but the relayer’s simulate reverted and dropped the broadcast).
  • Per-phase failure receipts: if any leg fails, the Telegram receipt names the specific phase (withdraw / verification_withdraw / invest / verification_invest) and a recovery CLI tailored to where the funds are (still in the old protocol vs idle in your sub-wallet).
  • Synthetic ledger close-out: a successful auto-move writes (auto_defi_withdraw, yield_copilot) rows to your otto_x_ops ledger so the next tick sees the OLD protocol closed + NEW open, and /yield-farming-historical treats the move as a realized round-trip for the closed deposit.
Status reads:
The audit trail is the source of truth for “what did Otto do for me?” — every entry carries tx hashes (where applicable) and the resolved investment IDs, so a user can reproduce any move on-chain. Pricing: all four endpoints are paywalled at $0.001 (registration / revocation / status / audit are bookkeeping; the value is the moves themselves which carry the standard $0.05 fee per leg via the underlying /auto-defi-withdraw + /yield-copilot calls Otto runs internally — same as a user-initiated rebalance). Launch posture: Tier 3 launches Base USDC Aave ↔ Compound V3 first, with Morpho-on-Base and multi-chain (Arbitrum / Optimism / Ethereum / X Layer) auto support landing in v1.1 once each chain has soaked a manual deposit + withdraw cycle on mainnet.

Yield status & receipts — GET /yield-farming-active, GET /yield-farming-historical

  • GET /yield-farming-active lists your active yield positions and, for each Otto-allowlisted lending position (Aave V3 / Compound V3 / Morpho stablecoin lending on Base / Arbitrum / Optimism / Ethereum / X Layer), adds a rebalance picture: current_apy_pct vs. best_alternative (the highest-rated allowlisted protocol for that stable on that chain — the APY is a protocol-level figure, since OKX picks the actual deposit market; it is never “the best vault is X”), apy_delta_pts, projected_annual_uplift_usd, and a recommendation of rebalance or hold with a plain-English why. A rebalance is suggested only when the gap clears both a minimum APY-delta and a minimum projected $/yr bar and you’ve held the position past a cooldown — it won’t nag you to chase rate noise. When you read your own sub-wallet, a rebalance recommendation includes the two-call switch: POST /auto-defi-withdraw {protocol, chain, token, ratio:"1"} then POST /yield-copilot {chain, token} (Otto re-picks the best venue at execution time, and the redeemed funds redeploy in full). The response also carries a yield_summary (total deployed, weighted-avg APY, projected annual yield, rebalances recommended).
  • A rebalance is informational — the new rate is not locked, switching protocols carries smart-contract/migration risk, you pay 2 × $0.05 in Otto fees (Otto absorbs the on-chain gas), and if the redeploy leg fails your funds simply sit idle in your own sub-wallet (re-call POST /yield-copilot). Not investment advice.
  • GET /yield-farming-historical is the receipt: your full yield-op timeline (deposits via /auto-defi-invest & /yield-copilot + redemptions via /auto-defi-withdraw) with the exact 0.05Ottofeeperopandtxhashes.Eachfullredemptioncarriesarealizedblockrealizedyieldusdandrealizedapypctcomputedexactly(theonchainamountthatactuallycamebacktoyoursubwallet,minuswhatyoudeposited;APYannualizedovertheholdingperiod)forpositionswhosedeposit(s)Ottorecorded;anullrealizedwithareasonmeansitcouldntbeattributedcleanly(e.g.partialwithdrawal,positionfundedexternally,oritpredatestheredeemedamountinstrumentation).Thesummaryaddsrealizedyield(lifetimerealized0.05 Otto fee per op and tx hashes. Each full redemption carries a `realized` block — `realized_yield_usd` and `realized_apy_pct` computed **exactly** (the on-chain amount that actually came back to your sub-wallet, minus what you deposited; APY annualized over the holding period) for positions whose deposit(s) Otto recorded; a `null` `realized` with a `reason` means it couldn't be attributed cleanly (e.g. partial withdrawal, position funded externally, or it pre-dates the redeemed-amount instrumentation). The `summary` adds `realized_yield` (lifetime realized , # closed round-trips with a realized figure) alongside the exact total Otto fees. For current rates use GET /yield-farming-active.

Custody Model (Important)

Otto X’s Agentic Wallet is TEE-custodial, not self-custodial:
  • Keys are generated and held inside OKX’s Trusted Execution Environment (TEE). Otto AI holds an API credential that authorizes signing; neither Otto nor OKX staff can export the underlying key.
  • Users do not control their sub-wallet directly. There is no seed phrase to back up, no MetaMask connection, no co-signer role.
  • This trades away the confirm-and-withdraw control of Otto AI’s Safe-based Trade Execution Agent — where you sign funding and withdrawals while an Otto-managed key signs execution — in exchange for fully autonomous execution (no user signing, no gas management, atomic operations).
  • POST /auto-withdraw is the escape hatch: users can sweep any token balance to any external address at any time. No approvals, no holds.
  • Otto runs an hourly GC that flags inactive empty sub-wallets to prevent capacity squat.
This posture is specific to Otto X on X Layer. Otto AI’s other agents differ: Market Alpha and Tools are read-only intelligence (they never touch your funds); Trade Execution runs on an agent-custodial Safe today (the user-owned Safe7579 model, with unrestricted runtime authority only after activation and until revocation, is rolling out in gated early access); and Prediction Markets trades via a dedicated Safe + Dynamic vault.

Aligned with Agent Payments Protocol §8.4

This split — funded wallet off the per-action signing path, hot key in the TEE for autonomous execution — is exactly the architecture OKX’s Agent Payments Protocol whitepaper (§8.4 Separating signing from custody) describes for production agent commerce. Otto X has been running this design on mainnet since March 2026, ahead of the protocol’s public release. Once the APP wire-format spec is published, Otto X sub-wallets are a drop-in Buyer-Agent runtime for charge, session, and upto intents. Recent clients collapse the old two-step funds-required dance into a single HTTP call by including a signed EIP-3009 TransferWithAuthorization note in the request body. The server verifies it, pulls your USDC (or USDT0 on X Layer) directly into your sub-wallet on-chain, then executes the op — all in one response. Client-side recipe:
  1. One-time previewGET /sub-wallet/preview?address=0xYOUR_WALLET (free). Cache sub_wallet.evm_address indefinitely; it’s deterministic per payer. (The unsuffixed GET /sub-wallet is the paid $0.01 resolve-or-provision route and will answer a free call with a 402.)
  2. Sign two things — your wallet signs:
    • The x402 service fee (standard paywall, $0.05 USDT0 on X Layer → Otto treasury).
    • An EIP-3009 TransferWithAuthorization note authorizing your USDC on the target chain to flow into your sub-wallet. Modern wallets (MetaMask, Coinbase Wallet, Rabby, Phantom) can batch both into one confirmation screen.
  3. POST the op — include principalAuth in the body:
Sent with the x402 fee in PAYMENT-SIGNATURE. Server guarantees, verified before touching the chain:
  • principalAuth.from MUST equal your x402 payer (no impersonation).
  • principalAuth.to MUST equal your provisioned sub-wallet (no draining to attacker addresses).
  • principalAuth.value MUST be ≥ the op’s required amount.
  • validBefore MUST be in the future; nonce MUST be unseen (replay-safe via a per-signer-per-token-per-nonce DB claim + on-chain authorizationState check).
The server then broadcasts token.transferWithAuthorization(...) (operator pays gas, user funds move straight from their wallet to their sub-wallet — no intermediate custody), tops up the sub-wallet with dust native gas if needed, executes the op, and returns 200 with all tx hashes.

Legacy Flow — HTTP 409 funds_required (fallback)

Clients that can’t sign EIP-3009 notes, or that target chains we haven’t enabled yet, fall back to the two-step flow. POST /auto-* without a principalAuth and with an insufficient sub-wallet balance returns:
Because the status is ≥ 400, x402 skips settlement — you’re NOT charged for the funds-required response. Only successful execution settles the service fee. The same idempotency key can be reused for up to 7 days to re-submit the original intent once funds arrive. Re-submitting the same body with a fresh key returns the same op (dedup on payer + op type + body hash).

Free Endpoints

x402 Payment Flow (OKX)

The flow is the same as our Base deployment, but settlement happens on X Layer via OKX Facilitator instead of CDP Facilitator.

Token Registry

Otto X maintains a curated registry of 16 X Layer tokens, available for free at GET /tokens. The paid GET /all-tokens endpoint returns the full X Layer token list from the OKX DEX Aggregator (the complete set of DEX-tradeable tokens on chain 196 — currently ~20, and it tracks OKX’s live registry).

Quick Start

For a full client example showing discovery and the 402 payment flow, see examples/client.ts in the GitHub repo.

The yield ladder, end to end

All three tiers are live today:
  • Tier 1 — one-call deploy: POST /yield-copilot deploys idle stablecoins into the highest-APY allowlisted lending venue in a single call.
  • Tier 2 — read side: GET /yield-farming-active returns rebalance recommendations, and GET /yield-farming-historical is the op receipt, including exact realized yield/APY per closed round-trip.
  • Tier 3 — monitoring: POST /yield-watch registers opt-in notify-only alerts, or a 30-day signed EIP-712 delegation for autonomous Aave↔Compound rebalances with hard guardrails (TVL floor, APY staleness, hysteresis, minimum-hold, per-position throttle, signed maxMoves / maxPrincipalRaw caps, post-broadcast verification, and per-phase failure receipts).
Each tier is documented in full in the Yield Copilot, Yield Watch, and Yield status & receipts sections above.