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…

Verify (no secrets in response)
# After starting the API, verify status (no secrets in response)
curl -s http://localhost:8006/api/v1/settings/environment | python -m json.tool

Trading (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_* or ALPACA_*).
  • Single-call override (REST): POST /api/v1/orders accepts optional JSON alpaca_auth mirroring google_auth for Workspace. For read/cancel/order-status GET or DELETE routes, send headers X-Pyactuator-Alpaca-Api-Key, X-Pyactuator-Alpaca-Api-Secret, optional X-Pyactuator-Alpaca-Paper.
Bash / zsh
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
PowerShell
$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
Mock broker (bash)
# Use the in-memory broker (default when Alpaca keys are missing)
export PYACTUATOR_ADAPTER=mock
pyactuator api

Google 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.

Bash / zsh
# 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
PowerShell
$env:PYACTUATOR_GOOGLE_APPLICATION_CREDENTIALS = "C:/path/to/service-account.json"

pip install 'pyactuator[google]'

pyactuator api

Open Google consoles

Loading adapter details…