- ›
/trading— link a user's brokerage account via OAuth and trade stocks, options & crypto through one Naïve key - ›
OAuth, not raw keys— each end-user authorizes their own brokerage account (paper or live); Naïve holds a per-user token, never raw credentials - ›
One order endpoint, every market— the symbol decides it (AAPL, BTC/USD, AAPL241213C00250000) - ›
Approval-gated by default— placing, cancelling, and closing are human-in-the-loop for your end-users' agents - ›
Naïve is the gateway, not the broker— the connected brokerage custodies and executes; you get OAuth, encrypted token storage, multi-tenant scoping, and one audit trail - ›
Free passthrough— Naïve doesn't charge per trade; orders settle in the user's own funded (or paper) brokerage account
Today we're launching /trading — an AI agent can now trade stocks, options, and crypto on a user's linked brokerage account through one Naïve key. The user authorizes via OAuth once; money-moving actions are human-approval-gated by default. Naïve is the governed gateway; the connected brokerage is the broker.
The problem
Wiring an agent into the markets has only had bad options:
- Raw keys. Handing the agent a brokerage key/secret gives it full account credentials — a security problem across a fleet of agents and users.
- DIY OAuth. Letting each user link their own account means building the auth-code flow, encrypted token storage, and per-user isolation yourself.
- Or become a broker. Going the full broker route means you create, custody, fund, and KYC accounts — months of compliance to buy one share.
How /trading works
- Links a user's brokerage account over OAuth — no raw credentials in your code, only your
nv_sk_*key. - Connect —
naive trading connect --env paperreturns anauthorize_url(+ adisclosureto show the user). They approve; Naïve stores the token encrypted and marks the connectionactive. - Read (no approval) —
naive trading account,positions,orders,quote. - Trade (approval-gated for end-users) —
naive trading orderto place;cancelandcloseto manage.
Two ways to trade: prompt or code
1. Natural language
# Connect once (open the returned authorize_url and approve)
naive trading connect --env paper
# Then trade — the symbol decides the market
naive trading order --symbol BTC/USD --notional 25 --side buy --type market --tif gtc
naive trading positions2. Code
import { Naive, isPendingApproval } from "@usenaive-sdk/node";
const naive = new Naive({ apiKey: process.env.NAIVE_API_KEY });
// Link a user's account — show the returned `disclosure`, then send them to authorize_url
const { authorize_url } = await naive.forUser("alice").trading.connect({ env: "paper" });
// Place an order — money-moving, so it may resolve to a pending approval
const res = await naive.forUser("alice").trading.createOrder({
symbol: "BTC/USD",
notional: "25",
side: "buy",
type: "market",
time_in_force: "gtc",
});
if (isPendingApproval(res)) {
// Gated by the user's Account Kit — wait for a human to approve.
await naive.forUser("alice").approvals.wait(res.approval_id);
}Or hit the REST API directly — the same endpoint trades every asset class:
curl -X POST https://api.usenaive.ai/v1/trading/orders \
-H "Authorization: Bearer $NAIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"symbol": "AAPL",
"qty": "2",
"side": "buy",
"type": "limit",
"limit_price": "150",
"time_in_force": "day"
}'One endpoint, every market
No separate stocks/crypto APIs — the order symbol picks the market, and the same params (qty or notional, side, type, time_in_force, limit_price, order_class) apply across all three:
| Stocks | Crypto | Options | |
|---|---|---|---|
| Symbol | AAPL | BTC/USD | AAPL241213C00250000 |
time_in_force | day, gtc, … | gtc, ioc | day, gtc |
| Hours | market + extended | 24/7 | market |
| Fractional | yes (notional/qty) | yes | no |
- Crypto must be enabled on the user's brokerage account (
account.crypto_status) — Naïve surfaces it, doesn't toggle it. - $10 minimum per crypto order — a smaller one returns a
forbiddenerror and leaves the connection intact.
Approval-gated by default
- Sensitive actions: place order, cancel order, close position.
- For end-users, an agent (API-key) call returns
202 { "status": "pending_approval", "approval_id" }— it runs only after a human approves it in the Approvals queue. - Reads are never gated — account, positions, orders, quotes.
- Operators set which actions require approval per Account Kit.
Naïve is the gateway, not the broker
- Links the user's account over OAuth — Naïve never holds raw brokerage credentials.
- Naïve doesn't open, custody, fund, or KYC accounts — the user's own brokerage account does that.
- Naïve does handle: the OAuth flow, encrypted per-user token storage, multi-tenant scoping, the audit trail, and the approval gate.
- A required disclosure is returned on
connectand shown as an "Authorize naive" consent step before redirect.
What you can build with /trading
- Trade on your users' direction — each end-user links their own brokerage account; orders are directed by the user and wait for their approval, and you never hold their keys.
- Multi-tenant, per-user trading product — scope
/tradingper tenant user so each customer trades only their own account, at their own direction; meter with/billing. - 24/7 crypto support — pair a scheduled agent with
notionalorders (≥$10) to prepare dollar-cost-averaging orders the user approves. - Research + execution on one key — compose with
/llmfor research and the Approvals queue for the human checkpoint on every trade. - Read-only portfolio monitoring —
account,positions, andquotewith no money-moving scope.
Get started
Drop this starter prompt into any coding agent to wire up Naïve:
Read https://usenaive.ai/skill.md and use it to set up Naïve in my project.
- Read the docs: usenaive.ai/docs/getting-started/trading
- API reference: usenaive.ai/docs/api-reference/trading/overview
- Quickstart: usenaive.ai/docs/getting-started/quickstart
- Join the community on Discord