entry
Place an order on any exchange you have linked to a hook, right now — or manage existing orders/positions on `symbol` via `action` (cancel open orders, close open positions, or flat/liquidate everything — Tradovate only). You fill structured order fields (symbol, side, quantity, type, price, trigger) — Autoview assembles the order for you. Or pass alert: the same command text a webhook body carries, which reaches the engine unchanged, so every syntax key a webhook supports is supported here. Dry-run by default: a bare call returns the parsed order without placing it; set live:true to place a real order. On a paid exchange without an active Autoview subscription, live:true is silently downgraded to a dry-run — the response then carries dry_run_forced:true and a dry_run_reason explaining why (see the `setup` tool for which exchanges this applies to, and where to subscribe). The order is relayed to the exchange asynchronously: this returns { queued, trace, canonical_id } immediately, not the fill. For a dry-run (the default), entry waits up to ~10s for the exchange's own reply and returns it as dry_run_events when it arrives in time — otherwise dry_run_pending:true, and you can poll the `events` tool with canonical_id (or trace) a moment later. Credentials come from hook_id -- the credentials you already linked to one of your hooks (see the `hooks` or `setup` tool) -- so no exchange secret is passed with the order. exchange is optional when that hook links to exactly one exchange; pass it explicitly if the hook links to more than one. If you don't have credentials linked yet, use the `command` tool to check an order's shape without a hook. Live limits: a live:true order (not cancel/close/flat) must fit this token's user-set caps AND, once your user has set them, the account caps (they cover every agent token on the account together; with none set, the token's caps alone apply), and any limits your user set for one exchange or one symbol on it, which can only be tighter; read them all with `live_limits`. It must be a limit order with price and a plain number quantity, in a USD or USD-stablecoin quoted market; the order's USD notional, the higher of quantity x limit price and quantity x trigger price (and on a sell, quantity x current bid from the exchange's quote when that is higher), must be at most the token's max order size (and the account's, if set), and today's totals (UTC day, counted at dispatch; per token, and for the whole account if an account daily limit is set) at most those daily limits. Refusal codes, each with fix steps: agent_trading_paused (your user paused all agent trading on the account; cancel/close/flat still work), agent_token_paused (your user paused this one token; cancel/close/flat still work), caps_not_set, caps_unavailable, cap_max_order_exceeded, cap_account_max_order_exceeded, cap_daily_limit_exceeded, cap_account_daily_limit_exceeded, cap_venue_max_order_exceeded, cap_venue_daily_limit_exceeded, cap_venue_daily_orders_exceeded (an exchange limit), cap_symbol_max_order_exceeded, cap_symbol_daily_limit_exceeded, cap_symbol_daily_orders_exceeded (a limit on one symbol on that exchange), cap_order_rate_exceeded (this token's limit on live orders per rolling minute, if your user set one; wait retry_after_s seconds), cap_limit_price_required, cap_quantity_unsupported, cap_quote_unsupported, cap_market_unsupported. Only your user can set or raise the caps, or pause and resume agent trading, at /account/tokens/. Requires your Autoview account token, except for a paper fill. No token? On BINANCE, BINANCEDELIVERY, BINANCEFUTURES, BINANCEUS, BITFINEX, BITGET, BITGETMIX, BITGETMIXCOPY, BYBIT, BYBITCOPY, BYBITEU, BYBITSPOT, COINBASE, CRYPTO, DERIBIT, GATE, GATEFUTURES, GEMINI, HUOBI, HUOBIFUTURES, HUOBILINEAR, HUOBISWAP, HYPERLIQUID, KRAKEN, KRAKENFUTURES, KUCOIN, KUCOINFUTURES, KUCOINFUTURESCOPY, OKX, OKXEEA, OKXUS, leave out token and hook_id, pass exchange and one order (structured, or one alert line with no & sections and no | or line breaks), and entry fills it on paper at the quote an Autoview zone reads from that venue's public market data: a buy at the ask, a sell at the bid, for a market order and for a limit order that crosses the quote (its limit price is echoed as limit_price). A limit order that does not cross the quote (a buy limit below the ask, a sell limit above the bid) is stored instead as an open paper order and returns { paper_order: true, order: { order_id, symbol, side, qty, limit_price, state: "open" }, cash, note }, moving neither cash nor the position; it fills at its limit price the first time a later quote crosses it, checked when paper_ledger reads that ledger or entry sends a paper order on that symbol to it (orders it filled come back as filled_orders). Cancel it with action cancel and order_id on the same ledger (paper_cancel: true; paper_order_unknown if that ledger has no such order, paper_order_not_open if it already filled or was cancelled). Every stored paper fill returns fill_id. An alert id= (your own order id, one word of up to 64 characters, or paper_sender_id_invalid) comes back as sender_id. On an account paper ledger (token, no hook_id) each fill also writes one entry of type paper_fill to the events tool, with canonical_id, fill_id and sender_id; the reply returns canonical_id, and a resting order uses its order_id as its canonical_id. A guest ledger writes no events. Nothing is sent to the exchange. The first fill opens a paper ledger for that exchange and returns paper_id, shown only once; pass it as paper_id on later no-token fills on the same exchange and each fill is recorded there; read it back with paper_ledger and that paper_id. It returns { paper_fill, exchange, fill, quote, stored, paper_id (first fill only), position: { symbol, qty (signed, negative is short), avg_price }, realized, cash }. cash is null until paper_reset sets a starting balance on the ledger; once set, a buy takes its notional from cash and a sell adds its notional, and a buy that costs more than the cash fills nothing (paper_insufficient_cash). Where the ledger is not available yet it returns stored:false and keeps nothing between calls. quantity must be a plain number of units; live:true, hook_id, action (except cancel with order_id), brackets, a percent or currency size, and more than one order are refused with a code (paper_live_refused, paper_hook_refused, paper_management_unsupported, paper_bracket_unsupported, paper_quantity_unsupported, paper_single_order_only, paper_order_invalid); so are a paper_id no ledger has (paper_id_unknown) and one from another exchange (paper_id_other_exchange). If the ledger cannot be written nothing fills (paper_ledger_unavailable). With no quote it fills nothing and returns the quote's code (quote_no_responders, quote_timeout, quote_no_answer, quote_unconfigured). No-token calls share the guest limits: 10 per hour per connection, 200 per hour for all guests (guest_rate_limited). With a token and no hook_id on those same venues, entry fills on paper the same way on the account's own paper ledger for that exchange, opened by the first fill (read it with paper_ledger and the token, set its cash with paper_reset). Any token may do this, including a dry-run-only one, and the guest limits do not apply. A testnet broker such as Alpaca Paper fills only on a live order, so it needs a live-scoped token. To keep a guest paper ledger after your user signs up, send its paper_id with the token: the first tokened call moves that ledger onto the account (the reply carries claimed:true) and the fill lands on it; from then on use the token and leave paper_id out, as the paper_id no longer works without the token. The same order refusals apply, plus: live:true (paper_live_refused: send hook_id for a hook linked to that exchange to trade live), a paper_id another account already took (paper_id_claimed: leave paper_id out), a paper_id when the account already has its own paper ledger on that exchange (paper_id_not_merged: the account ledger is kept and the guest ledger is not merged; leave paper_id out, or leave the token out to keep the guest ledger), paper_id_unknown, paper_id_other_exchange, and an exchange outside the token's scope (paper_exchange_out_of_scope). With a hook_id, entry trades that hook's linked exchange as above. With no token on any other exchange, entry is refused (paper_venue_unsupported): there is no paper venue there yet, so send the token with hook_id for a hook linked to that exchange, or use sandbox_run.