For Agents
Run a self-directed Alpaca account: place and cancel orders, manage positions and watchlists, read account activities, and check the market calendar through one set of API keys.
Get started with Alpaca Trading API in minutes using your preferred integration method.
# Add to your MCP client config (Claude Desktop, Cursor, Windsurf)
{
"jentic": {
"url": "https://api.jentic.com/mcp",
"auth": "oauth"
}
}
# Then ask your agent:
"place an Alpaca trading order"
# → Jentic returns the GET /events tool with parameter schema, agent executes.What an agent can do with Alpaca Trading API API.
Place, replace, and cancel stock, options, and crypto orders
List open positions and close one or all of them
Exercise an options position before or at expiry
Create, update, and delete watchlists by ID or by name
Read account activities, configurations, and portfolio history
GET STARTED
Use for: I need to place a market buy order for 10 shares of AAPL, Cancel all open orders on my account, Close all open positions immediately, Get my current portfolio history for the last month
Not supported: Does not handle market data feeds, customer account opening, or KYC — use for self-directed order placement, position and watchlist management, and account activities only.
The Alpaca Trading API is the self-directed trading surface of the Alpaca platform, designed for individual developers and algorithmic traders running their own brokerage account. It exposes orders, positions, watchlists, account configurations, account activities, market calendar and clock, assets, options contracts, corporate actions, crypto funding wallets, and portfolio history. Authentication uses APCA-API-KEY-ID and APCA-API-SECRET-KEY headers, and live and paper environments are exposed at api.alpaca.markets and paper-api.alpaca.markets respectively. With 44 endpoints, this API is focused on trading, not on opening or managing customer accounts.
Look up assets by symbol or ID and read option contracts
Manage crypto funding wallets, transfers, and whitelisted addresses
Patterns agents use Alpaca Trading API API for, with concrete tasks.
★ Algorithmic order placement
Trading bots place orders via POST /v2/orders, replace open orders via PATCH /v2/orders/{order_id}, and cancel via DELETE /v2/orders/{order_id} or DELETE /v2/orders for all open orders. The same surface covers stock, options, and crypto orders, so a single integration handles cross-asset strategies.
Place a market buy order for 5 shares of NVDA via POST /v2/orders, then poll GET /v2/orders/{order_id} until status is filled.
Position management and risk control
Risk controls call GET /v2/positions to read current exposure, DELETE /v2/positions to flatten the book, or DELETE /v2/positions/{symbol_or_asset_id} to close a single position. Combined with GET /v2/account/portfolio/history, this lets a daily risk job evaluate drawdown and rebalance without leaving the API.
If end-of-day drawdown exceeds 2 percent, call DELETE /v2/positions to close all open positions on the account.
Options trading workflow
Options traders look up contracts via GET /v2/options/contracts, place orders for chosen contracts via POST /v2/orders, and exercise positions via POST /v2/positions/{symbol_or_contract_id}/exercise. The trading surface mirrors the stock workflow which keeps the option logic small.
Find SPY put contracts expiring this Friday via GET /v2/options/contracts, then place a buy-to-open order for the chosen strike.
Watchlist and market context
Apps maintain user-curated watchlists via /v2/watchlists and the by-name variant /v2/watchlists:by_name, then check the market clock via GET /v2/clock and the calendar via GET /v2/calendar to schedule trading windows. Asset metadata via /v2/assets fills out symbol details for the UI.
Add AAPL to the watchlist named 'tech-picks' via POST /v2/watchlists:by_name, then check GET /v2/clock to confirm the market is open.
AI agent self-directed trading
An AI agent assistant can suggest trades, place them after explicit confirmation, and read back portfolio history to summarise performance. Through Jentic the agent searches by intent, loads the order schema, and executes — APCA keys stay in the vault and never enter the prompt context.
Use Jentic to search 'place an Alpaca order', execute POST /v2/orders after the user confirms, and report the fill via GET /v2/orders/{order_id}.
44 endpoints — the alpaca trading api is the self-directed trading surface of the alpaca platform, designed for individual developers and algorithmic traders running their own brokerage account.
METHOD
PATH
DESCRIPTION
/v2/orders
Create an order
/v2/orders
List orders
/v2/orders/{order_id}
Cancel an order
/v2/positions
List open positions
/v2/positions
Close all positions
/v2/account/portfolio/history
Account portfolio history
/v2/clock
Market clock
/v2/options/contracts
List option contracts
/v2/orders
Create an order
/v2/orders
List orders
/v2/orders/{order_id}
Cancel an order
/v2/positions
List open positions
/v2/positions
Close all positions
/v2/account/portfolio/history
Three things that make agents converge on Jentic-routed access.
Credential isolation
APCA-API-KEY-ID and APCA-API-SECRET-KEY are stored encrypted in the Jentic vault and injected at execution time. Agents call operations by intent — the raw key and secret never enter the prompt context.
Intent-based discovery
Agents search 'place an Alpaca order' or 'close all positions' and Jentic returns the matching operation with its full input schema, including order side, type, qty, and time-in-force fields.
Time to first call
Direct Alpaca Trading integration: 2-3 days across order management, positions, watchlists, and event handling. Through Jentic: under 30 minutes — search, load, execute per operation.
Alternatives and complements available in the Jentic catalogue.
Alpaca Market Data API
Market Data feeds the prices that drive Trading orders
Use Alpaca Market Data alongside Trading when the agent needs live or historical prices to decide on orders
Alpaca Broker API
Broker is the multi-account, branded brokerage variant of Trading
Choose Alpaca Broker when trading on behalf of customer accounts; choose Trading for the developer's own account
Plaid
Plaid links a bank account for funding the Alpaca brokerage
Use Plaid when bank verification or balance checks are needed before sending funds into Alpaca
OpenAI
OpenAI summarises market context that informs Trading API calls
Use OpenAI when natural-language reasoning over market data should drive a confirmed order via Alpaca Trading
Specific to using Alpaca Trading API API through Jentic.
What authentication does the Alpaca Trading API use?
Two header-based API keys: APCA-API-KEY-ID and APCA-API-SECRET-KEY. Through Jentic, both values are stored encrypted in the vault and injected at execution time, so they never appear in agent prompts or logs.
Can I place options orders through the Trading API?
Yes. Look up contracts via GET /v2/options/contracts, then place an order with POST /v2/orders specifying the contract symbol. Exercise an options position via POST /v2/positions/{symbol_or_contract_id}/exercise.
How do I cancel all open orders via Jentic?
Run pip install jentic, search 'cancel all Alpaca orders', load the input schema for DELETE /v2/orders, and execute. The endpoint cancels every open order on the authenticated account.
Is there a paper trading endpoint?
Yes. The spec lists https://paper-api.alpaca.markets alongside the live https://api.alpaca.markets endpoint. Use the paper URL to develop and test without placing real orders.
Can I read portfolio history for performance reporting?
Yes. GET /v2/account/portfolio/history returns equity and profit and loss values across a chosen period, suitable for daily or weekly performance summaries.
Does the Trading API include market data?
No. Use the separate Alpaca Market Data API for bars, quotes, trades, and snapshots. The Trading API exposes asset metadata and the market clock but not pricing data.
Account portfolio history
/v2/clock
Market clock
/v2/options/contracts
List option contracts