account:readAccount
Balances, buying power, account state, and configured risk tier.
Developer documentation · v1
The complete contract for authentication, account reads, idempotent order writes, timeout reconciliation, rate limits, market data, and resumable account events.
Store the secret outside source control, pass it as a Bearer token, and inspect the structured status before writing orders.
curl "https://mayospell.vercel.app/api/v1/account" \
+ -H "Authorization: Bearer $MAYOSPELL_API_KEY"Research keys read account and market data; execution keys place the limited orders the sandbox supports. Separate keys keep every revocation contained to one integration.
account:readBalances, buying power, account state, and configured risk tier.
orders:readWorking, filled, cancelled, rejected, and expired orders.
orders:writeIdempotent limit orders, working-order cancellation, and sell-to-close requests.
positions:readOpen long option positions with conservative marks.
marketdata:readContract discovery, quote snapshots, bars, and authenticated quote events.
events:readResumable order and fill events using Last-Event-ID.
Every authenticated route is account-isolated. Order mutations accept limit orders only and enforce the current sandbox risk policy at the service boundary.
/healthPublic/accountaccount:read/ordersorders:read/ordersorders:write/orders/{orderId}orders:read/orders/{orderId}orders:write/positionspositions:read/positions/{symbol}/closeorders:write/fillsorders:read/contractsmarketdata:read/quotesmarketdata:read/barsmarketdata:read/market-streammarketdata:read/eventsevents:readimport os, uuid, requests
BASE_URL = "https://mayospell.vercel.app/api/v1"
API_KEY = os.environ["MAYOSPELL_API_KEY"]
client_order_id = str(uuid.uuid4())
response = requests.post(
f"{BASE_URL}/orders",
headers={
"Authorization": f"Bearer {API_KEY}",
"Idempotency-Key": client_order_id,
},
json={
"clientOrderId": client_order_id,
"symbol": "SPY260821C00600000",
"side": "buy",
"quantity": 1,
"type": "limit",
"limitPrice": 1.25,
"timeInForce": "day",
},
timeout=10,
)
response.raise_for_status()
order = response.json()
print(order["order"]["id"])const baseUrl = "https://mayospell.vercel.app/api/v1";
const clientOrderId = crypto.randomUUID();
const response = await fetch(baseUrl + "/orders", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.MAYOSPELL_API_KEY,
"Content-Type": "application/json",
"Idempotency-Key": clientOrderId,
},
body: JSON.stringify({
clientOrderId,
symbol: "SPY260821C00600000",
side: "buy",
quantity: 1,
type: "limit",
limitPrice: 1.25,
timeInForce: "day",
}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());Every API error includes error.code, error.message, and requestId. Preserve requestId in logs and support evidence.
invalid_requestSchema, query, symbol, or idempotency input is invalid.
unauthorizedThe Bearer key is missing, invalid, expired, or revoked.
forbiddenThe key lacks scope, ownership, environment, or risk permission.
not_foundThe account-owned resource does not exist.
idempotency_conflictA key was reused with a different payload, or order state prevents the action.
rate_limitedThe per-key distributed window is exhausted; honor Retry-After.
These rules are part of the integration contract. A bot that ignores them can turn a recoverable outage into an unsafe order sequence.
A UUID Idempotency-Key must match clientOrderId. Reusing it with different content returns 409.
After a timeout, read the exact order before deciding whether any new write is safe.
Use RateLimit-* and Retry-After headers. Back off with jitter; never spin against 429.
Persist the last processed event ID and reconnect account events with Last-Event-ID.
Quote age, disconnected streams, and degraded provider posture are stop conditions—not permission to estimate.
Use a separate scoped key per bot, keep it in a secret manager, rotate it, and revoke it when retired.
The API is online, but the configured Tradier credential currently returns 401 and the tested Alpaca option feeds lack the required entitlement. Treat quote and bar availability as degraded until provider access is repaired. Never substitute estimated prices in an execution bot.