An Interactive Brokers trading account with a minimum 10K USD deposit will get you access to their trading API. If you can deposit 25K, you'll be OK with pattern day-trader status and gain 4x leverage for your account.
They also offer a paper-trading account for testing purposes. They give you $1M in funny money to trade with to test your algos.
Even cheaper, if you want to trade futures, the margin requirements are even lower, $500-1000 minimum, and you can use Ninjatrader as your trading platform for certain brokerages. Ninjatrader has a pretty good C# interface to trade with. You have to pay for Ninjatrader if you want to trade, but you can sim trade and write your own trading strategies and backtest for free until you're ready to trade for real.
They also offer a paper-trading account for testing purposes. They give you $1M in funny money to trade with to test your algos.