Before you start
- A free Saxo developer account (simulation)
- For live: a Saxo trading account and app approval
Create your Saxo OpenAPI API key
- 1
Sign up on the developer portal
Create an account at developer.saxo; a simulation trading account is created for you.
- 2
Get a 24-hour token
In the portal, generate the 24-hour token for quick testing against the SIM gateway.
- 3
Register an application
Under Application Management, create an app with grant type Code (or PKCE) and a redirect URL. Copy the App Key and App Secret.
- 4
Authorize and save the refresh token
Run the authorization-code flow once in a browser, exchange the code for tokens and store the refresh token as
SAXO_REFRESH_TOKEN.
Test the key
Before wiring the key into a strategy, make one request by hand. It separates “the key is wrong” from “my code is wrong”.
curl -s -H "Authorization: Bearer $SAXO_TOKEN" \
https://gateway.saxobank.com/sim/openapi/port/v1/users/me401 means it expired.Keep the credentials safe
- Store values in a password manager or a git-ignored
.env, never in code or notebooks you share. - In an AlgoGP project you can still add them under APIs & keys (encrypted at rest) and read them with
strategy_runtime.secrets.get("SAXO_APP_KEY"). - Give each bot its own credential so you can revoke one without stopping the others.
SAXO_APP_KEY=paste-your-value-here
SAXO_APP_SECRET=paste-your-value-here
SAXO_REFRESH_TOKEN=paste-your-value-hereFrequently asked questions
Do simulation tokens work on live?
No. Simulation and live use different gateways, apps and credentials.
Design and backtest your Saxo OpenAPI strategy first
AlgoGP turns an idea into Python and tests it on years of history before you connect it to Saxo OpenAPI. The exported code keeps the broker behind four small adapter methods.
- AI copilot writes and revises the rules
- Backtests with realistic costs
- Exported Python ready to wire to Saxo OpenAPI
Free plan, no card required.
AlgoGP is not affiliated with Saxo OpenAPI. Menus get renamed from time to time; if a label differs, the official documentation has the current path.