Public REST API on Cloud¶
HaasOnline TradeServer Cloud exposes a public REST API, so you can manage your bots, scripts, accounts, orders and market data programmatically - from your own code, scripts or tools.
The complete reference (every endpoint, request and response, with examples) lives at docs.haasapi.com. This page explains how to get a key and what to expect.
Looking for AI agents instead?
To connect Claude, Cursor or another AI assistant, you want AI Agent Access (MCP) - a one-click browser flow with no key to manage. The REST API below is for writing your own integrations.
Availability¶
The REST API is included on the Standard, Pro and TradeServer plans, and throughout your free trial.
It is not included on the Starter plan. On Starter the API Keys screen is hidden, and any key still presented to the API is refused - upgrade to use it.
Create an API key¶
- Open Settings → API Keys in the app.
- Click Add, give the key a name, and (optionally) restrict it to specific scopes and IP addresses.
- Copy the key now - the full token is shown once and cannot be retrieved again. Store it somewhere safe.
Your key is a bearer token prefixed hk_live_. Send it on every request:
A key is full access to your account
An API key can do anything you can, including placing and cancelling trades. Treat it like a password: never share it or commit it to source control, scope it down where you can, and revoke it the moment it might be exposed (Settings → API Keys → Revoke).
Base URL and rate limits¶
- Base URL:
https://rest.haasapi.com/v1 - Requests are rate limited per key. Each response carries
RateLimit/RateLimit-Policyheaders telling you your remaining budget; a429response includes aRetry-After. Don't retry-storm - back off for the number of seconds it gives you.
Next steps¶
Head to docs.haasapi.com for the full endpoint reference, authentication details, error codes and language examples.