Settings
Configure credentials on the machine that runs the PyActuator API. This page shows status and copy-paste snippets (no secrets in API responses). Google console forms can optionally send canonical google_auth.service_account in the request body for a single call; prefer env or pyactuator.toml for normal operation.
API
API URL (env):
When served by pyactuator ui serve, requests to /api/* are proxied to the PyActuator API server. After changing environment variables, restart the API process.
Credential status (API process)
Loading…
# After starting the API, verify status (no secrets in response)
curl -s http://localhost:8006/api/v1/settings/environment | python -m json.toolTrading (Alpaca)
PyActuator speaks to the market through the Alpaca REST API when PYACTUATOR_ADAPTER=alpaca and keys are set. The default broker is otherwise in-memory mock.
- Preferred server config: env vars below (
PYACTUATOR_ALPACA_*orALPACA_*). - Single-call override (REST):
POST /api/v1/ordersaccepts optional JSONalpaca_authmirroringgoogle_authfor Workspace. For read/cancel/order-status GET or DELETE routes, send headersX-Pyactuator-Alpaca-Api-Key,X-Pyactuator-Alpaca-Api-Secret, optionalX-Pyactuator-Alpaca-Paper.
export PYACTUATOR_ADAPTER=alpaca
export PYACTUATOR_ALPACA_API_KEY="YOUR_API_KEY"
export PYACTUATOR_ALPACA_API_SECRET="YOUR_API_SECRET"
# optional — aliases: ALPACA_API_KEY / ALPACA_API_SECRET
# paper trading (default true):
export PYACTUATOR_ALPACA_PAPER=true
pyactuator api$env:PYACTUATOR_ADAPTER = "alpaca"
$env:PYACTUATOR_ALPACA_API_KEY = "YOUR_API_KEY"
$env:PYACTUATOR_ALPACA_API_SECRET = "YOUR_API_SECRET"
$env:PYACTUATOR_ALPACA_PAPER = "true"
pyactuator api# Use the in-memory broker (default when Alpaca keys are missing)
export PYACTUATOR_ADAPTER=mock
pyactuator apiGoogle Workspace (API)
Real Google adapters need a service account JSON key on the API server. Set PYACTUATOR_GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_APPLICATION_CREDENTIALS, or [google].application_credentials in pyactuator.toml (see resolution order in the shell snippets). Install optional deps.
# Path must be on the machine running the API (not this browser)
# Resolution order:
# 1. PYACTUATOR_GOOGLE_APPLICATION_CREDENTIALS
# 2. GOOGLE_APPLICATION_CREDENTIALS
# 3. [google].application_credentials in ./pyactuator.toml
export PYACTUATOR_GOOGLE_APPLICATION_CREDENTIALS="/absolute/path/to/service-account.json"
pip install 'pyactuator[google]'
pyactuator api$env:PYACTUATOR_GOOGLE_APPLICATION_CREDENTIALS = "C:/path/to/service-account.json"
pip install 'pyactuator[google]'
pyactuator apiLoading adapter details…