Nexus/API Reference/Options and stocks

Open a trade (options, stocks or futures)

POSThttps://app.skylit.ai/api/nexus/v1/trades

One route for every asset class. assetClass picks the book.

  • Options are bought to open. Send contract as shorthand (like SPY 600C 10/16), or ticker, strike, direction and expiration. Not both. 1 to 1,000 contracts. A market order fills now at the ask. "orderType": "limit" with limitPrice rests at your price: it fills at your limit when the ask comes down to it (at the ask right away if the ask's already there when you send it). timeInForce is day (until 4:00 pm ET; sent after the close, it works the next session) or gtc (until 4:00 pm ET on the contract's last trading day).
  • Stocks take ticker, side (buy or sell, where sell opens a short) and quantity, 1 to 100,000 shares. A market order fills now at the last trade, and refuses a price more than 15 seconds old (503 stale_quote). "orderType": "limit" with limitPrice fills at your limit when a trade prints at or through it (at the last trade right away if it's already there when you send it). "orderType": "stop" with stopPrice waits for a trade through your stop, then fills at the next trade. Resting stock orders only fill between 9:30 am and 4:00 pm ET (1:00 pm on early-close days), and gtc works for 90 days.
  • A resting options or stock open holds back buying power (contracts x limit x 100, or shares x limit or stop, a short included) until it fills, is cancelled or expires. It answers 201 with the order ("status": "working"). If the market's already through your price it fills right away, with "status": "filled", fillPrice, tradeId and meta.fill. Manage it with the Options and stocks resting orders routes. A limit or stop fill isn't posted to Discord and isn't copied.
  • Futures take ticker (a product like NQ for the front month, or one contract like NQZ26), side, quantity (1 to 100) and optionally account. A market order fills now. orderType: "limit" with limitPrice, or "stop" with stopPrice, rests until the market trades through it. "stop_limit" takes both: nothing happens until a trade hits your stop, then it works as a limit at limitPrice and only fills at that price or better. A buy's limit has to be at or above its stop, a sell's at or below. Add stopLoss, takeProfit and trailingStop for a bracket on any order type: each leg is an order of its own, held while the entry rests and working once it fills. A resting order can wait on a quiet market. A market order needs a trade in the last 15 seconds to open or add.
  • reduceOnly stops a sell from opening a short when a stop already took you flat a second earlier. With reduceOnly: true the order goes through only if it shrinks what you hold, checked when it books. Otherwise it answers 422 reduce_only_would_open and nothing is placed. It works on a market order with no bracket.
  • Futures go to your practice account unless account names another: "agent" (your bot's account), "evaluation" or "funded" when you have exactly one running, or an account id from capabilities. Evaluation and funded accounts keep all their rules (daily loss, max loss, contract cap). Challenge entries can't be traded through the API.
  • "account": "agent" sends an options or stock order to your bot's own paper wallet instead of yours. It holds back the bot's buying power and its trades stay private.
  • Already hold the contract? Don't send a second open (409 duplicate_position, with tradeId): add to it with POST /api/nexus/v1/trades/{id}/adds. A limit buy on a contract you hold adds to that position when it fills.
  • Add "test": true to check and price the order without placing it. See Test orders in the intro.

A new options or stock market trade answers 201 with the trade. A resting options or stock order answers 201 with the order. A futures order answers 201 with the order and its bracket. A repeated clientOrderId answers 200 with the first one.

Authorization

Authorization: Bearer <your API key>

Required. A missing header returns 401; an invalid, revoked or expired key returns 403.

Headers

  • Idempotency-Keystring

    Your clientOrderId, as a header instead of a body field. If you send both they must match.

Request body

  • assetClassstring

    Which book the order goes to.

    optionsstocksfutures
  • contractstring

    Options shorthand, like SPY 600C 10/16 or SPY 600C 10/16 @ 1.84. Send this, or ticker, strike, direction and expiration.

  • tickerstring

    A symbol like SPY. For futures, a product like NQ (the front month) or one contract like NQZ26.

  • directionstring

    Options only.

    callput
  • strikenumber

    Options only, like 600 or 602.5.

  • expirationstringdate

    Options only, like 2026-10-16.

  • sidestring

    Stocks and futures. Options are always bought to open.

    buysell
  • quantityinteger

    Options 1 to 1,000 contracts, stocks 1 to 100,000 shares, futures 1 to 100 contracts.

  • pricenumber

    Options and stocks: your own fill price, taken only inside the window around the live quote.

  • ifOutsidestring

    What happens when price is outside the window: refuse, or fill at market.

    rejectmarket
  • orderTypestring

    Options take market or limit. Stocks take market, limit or stop. Futures take market, limit, stop or stop_limit (with both stopPrice and limitPrice).

    marketlimitstopstop_limit
  • limitPricenumber

    A limit or stop-limit: the price the order rests at. Options and stocks in cents, like 2.45 (options up to 99,999.99, stocks up to 999,999.99).

  • stopPricenumber

    A stock stop, or a futures stop or stop-limit: the price that triggers it.

  • timeInForcestring

    Options and stock limits and stops. day works until 4:00 pm ET (sent after the close, the next session). gtc works until the option's last trading day, or 90 days for a stock.

    daygtc
  • stopLossnumber

    Futures: a stop loss placed with the entry.

  • takeProfitnumber

    Futures: a take profit placed with the entry.

  • trailingStopboolean

    Futures: the stop loss trails the price. Needs stopLoss.

  • reduceOnlyboolean

    Futures: only take contracts off a position you hold, never open, add or flip. Market orders with no bracket.

  • accountstring

    agent sends any order to your bot's own agent account. Futures also take practice (the default), evaluation, funded, or an account id. For options and stocks, leave it out for your own paper wallet.

  • clientOrderIdstring

    Your own id for safe retries. 1 to 64 letters, digits, or _ . : -.

  • testboolean

    true checks and prices the order, then keeps it in your test log instead of placing it.

Responses

  • 200

    A repeated clientOrderId: the first order, with meta.idempotentReplay: true. Nothing new was placed.

  • 201

    Filled, or resting. An options or stock market order answers a Trade, an options or stock limit or stop a WalletOrder, futures a FuturesOrder. A test order is the same shape with "test": true.

  • 400

    The request was refused before anything was traded. Codes: bad_request, bad_contract, invalid_quantity, invalid_price, unsupported_asset_class, unsupported_order_type, only_market_orders, limit_price_required (a limit with no limitPrice), invalid_limit_price (not in cents, or outside 0.01 to 99,999.99 for options or 999,999.99 for stocks), stop_price_required (a stop with no stopPrice), invalid_stop_price (not in cents, or outside 0.01 to 999,999.99), invalid_take_profit, test_orders_unavailable, test_modify_unavailable.

  • 401

    No key, or a key that isn't valid. Codes: missing_api_key, invalid_api_key.

  • 403

    The key works but the account can't do this. Codes: account_suspended, nexus_access_denied, futures_access_denied.

  • 404

    Not on your account. Codes: trade_not_found, account_not_found, order_not_found.

  • 409

    The order clashes with what you hold or sent before. Codes: duplicate_position (with tradeId: add to it instead), trade_closed, open_position_limit (open positions plus resting opens through the API are at 50), working_order_limit (50 options and stock orders already resting through the API), position_size_limit (an add would take the position past 1,000 contracts or 100,000 shares), client_order_id_used, request_in_progress, account_locked, account_busy, account_ended, order_not_working (it already filled, expired, or was cancelled or rejected), stop_triggered (a stop that's been set off is filling now, so it can't be cancelled or changed).

  • 422

    Read fine, but the market or the account says no. Codes: market_closed, contract_expired, contract_not_offered, price_outside_market, insufficient_buying_power, account_not_tradable, account_ambiguous, reduce_only_would_open, order_refused, order_rejected (a resting order that tried to fill right away and couldn't; orderId points to it). A resting order that can't be covered answers insufficient_buying_power with orderId too: it's recorded as rejected.

  • 429

    Over a rate limit. Wait Retry-After seconds, then retry. Codes: rate_limited, and stream_limit_reached (too many live streams open: 3 per key, 6 per account).

  • 500

    Something went wrong on our side. If you sent a clientOrderId, retry with the same one. Code: internal_error.

  • 503

    Try again in a moment (honour Retry-After when it's sent). Codes: stale_quote (the quote, or a stock's last trade, is more than 15 seconds old, so nothing filled), no_live_price, rules_pending, unavailable, auth_unavailable, access_check_unavailable, api_keys_unavailable, trades_api_disabled, stream_unavailable (the live stream isn't on, or the server is restarting: try again shortly, or poll the reads).

Response fields

  • dataobject

    An options or stock trade, as Nexus shows it. Stocks use direction call for long and put for short, strike 0 and today's date. Nexus may add other fields it shows on a trade (Greeks, P/L, reactions).

    • idstringuuid
    • userIdstringuuid
    • tickerstring
    • strikenumber
    • expirationstringdate
    • directionstring
      callput
    • assetClassstring
      optionsstocks
    • averageEntryPricenumber
    • currentPricenumber

      The latest mark.

    • totalQuantityinteger
    • remainingQuantityinteger
    • statusstring
      activeclosed
    • entryDatestringdate-time
    • exitDatestringdate-time
    • exitsobject[]
    • sourcestring

      api on a trade a key opened.

    • testboolean

      true on a test order.

  • metaobject

    Extra facts about an order. Each field is there only when it applies.

    • fillobject

      The fill: price, priceSource (market or client), and when you sent a price, the bid and ask it was checked against. On an exit, quantity is how many sold.

    • clientOrderIdstring
    • idempotentReplayboolean

      This answer is a repeat of an earlier order with the same clientOrderId.

    • testboolean

      A test order: nothing was placed.

    • notCheckedstring[]

      Futures test orders: what the preview couldn't check, like account_rules_judgment or bracket_netting.

    • discordRoutingobject

      Where Nexus routed the trade to Discord, when it did.

    • nothingToCloseboolean
    • stillOpenstring[]

      A repeated closeAll: positions still open.

    • tradeIdstringuuid

      A resting exit or an options stop: the trade it closes or protects.

    • triggerOnstring

      An options stop: underlying.

    • underlyingPricenumber

      An options stop: the stock's price right now.

    • marketOpenboolean

      An options stop: whether the market's open for the contract.

    • firesNowboolean

      An options stop: the stock's already through a level, so it fires on the next check. firesOn says which leg.

    • wouldFireNowboolean

      A test options stop: what firesNow would say.

    • wouldFillNowboolean

      A test limit: whether the real one would've filled right away, with fillPrice.

    • wouldTriggerNowboolean

      A test stock stop: the last trade's already through it.

    • wouldRestBecausestring

      A test limit: why the real one would rest.

    • alreadyCancelledboolean

      A repeated cancel: it was already cancelled.

Last updated

Was this page helpful?