Skip to content
Alpaca logo

Connectors / Finance · HTTP Connector

Alpaca integration and API

Create an order and create a watchlist in Alpaca. Connect Alpaca to the rest of your finance stack with Tray.ai.

What can you do with Alpaca on Tray.ai?

Alpaca is a brokerage platform with an API for trading US stocks, options, and crypto, plus paper trading accounts for testing strategies. Tray.ai connects to Alpaca through the HTTP Connector, so your workflows can call the Alpaca API alongside the rest of your stack.

  • Create an order when your trading model flags a buy, so trades go out without manual entry.
  • List open positions each evening and write them to your reporting database.
  • Close a position automatically when your risk system flags a limit breach.
  • List account activities each night and send the trades to your accounting system to reconcile.
Connects through
HTTP Connector
Authentication
An API key in a request header or basic authentication
Base URL
https://api.alpaca.markets

Set it up

Connect Alpaca to Tray.ai

Each step uses Alpaca's own API details, from its documentation.

Save Alpaca's API key

Save the key as a Tray.ai authentication. The HTTP Client puts it in the request header, read from $.auth. The key stays out of the workflow and out of the logs.

Point the HTTP Client at the API

Add an HTTP Client step and use https://api.alpaca.markets as the base URL. Or paste a cURL example from Alpaca's API docs, and Tray.ai fills in the method, URL, and headers.

Start with “List orders”

It's one of 18 documented actions, under Orders. The response comes back as data the next step can map into your other apps.

Hand it to an AI agent

Wrap “Create an order” and “Get an order” in workflows, and Tray.ai's Agent Gateway for MCP publishes them as governed tools Claude and other AI agents can call.

Workflows to build with Alpaca

Connect Alpaca with Snowflake and Slack

Each one uses actions and events from Alpaca's own API documentation.

Copy Alpaca account activities to Snowflake each day

When

On a schedule

Then

  1. List account activities in Alpaca for the day
  2. Load fills and dividends into Snowflake

With Snowflake

Post open Alpaca positions to Slack each morning

When

On a schedule

Then

  1. List open positions in Alpaca
  2. Post a position summary to the trading channel in Slack

With Slack

Apps you can build on Alpaca data

Internal tools your team can build with an AI assistant, each one using Alpaca calls from its API documentation.

Portfolio positions dashboard

Shows open positions with asset details and lets a trader close one position or all of them.

Open order review

Lists open orders and lets a trader change or cancel an order.

Account activity report

Reports account activities by type for a monthly trading review.

Alpaca MCP server for AI agents

Build an MCP server on Alpaca in Agent Gateway and choose which actions your agents can call. Every call runs with access control and an audit trail. How Agent Gateway works

  • Create an order
  • List open positions
  • List watchlists
  • List assets
  • List account activities
  • List orders
  • Get an order
  • Replace an order

What the Alpaca API covers

5 resources and 18 documented actions, each one a call the HTTP Connector can make from a Tray.ai workflow. Connecting it takes a few clicks: here's how.

Orders

  • Create an order
  • List orders
  • Get an order
  • Replace an order
  • Cancel an order

Positions

  • List open positions
  • Get an open position
  • Close a position
  • Close all positions

Watchlists

  • List watchlists
  • Create a watchlist
  • Update a watchlist
  • Delete a watchlist
  • Add an asset to a watchlist

Assets

  • List assets
  • Get an asset

Account activities

  • List account activities
  • List activities by type

Checked against Alpaca's own documentation on 2026-10-22

docs.alpaca.markets/docs/getting-started-with-trading-api

Frequently asked questions

What can a Tray.ai workflow do in Alpaca?

The Alpaca API documents 18 actions across 5 resources (Orders, Positions, Watchlists, Assets, Account activities). For example: Create an order; List open positions; List watchlists. A workflow can make any documented call through the HTTP Connector.

How does Tray.ai authenticate with Alpaca?

The Alpaca API uses an API key in a request header and basic authentication. You save it once as a Tray.ai authentication, and the HTTP Connector adds it to every request.

See Alpaca working against your stack.

We'll walk through a tailored demo with your systems plugged in.

Great, a couple more details

This helps us connect you with the right person. Optional, and you can skip it.