Skip to content

Environments

HalvorAI has two environments. They are separate deployments with separate databases, so test and live data never mix.

SandboxProduction
API base URLhttps://api.sandbox.halvorai.comhttps://api.halvorai.com
Key prefixhk_test_hk_live_
Event environmenttestlive
PurposeBuilding and testing your integrationReal payments
Test data retention30 days, then purged7 years by default

Every API key belongs to one environment, and its prefix tells you which. A key only works against its own environment’s API. If you send a test key to production, or a live key to the sandbox, the API answers 401 with the error code key_environment_mismatch and a message naming both. Nothing is stored.

The SDK picks the right base URL from the key prefix, so you rarely set it yourself.

Each event carries an environment field. It has to match the key that sends it. An event that says live sent with a test key is rejected with environment_mismatch, and the rest of the batch is unaffected.

  1. Create a live key in the production dashboard. Live keys can be created by admins and owners.
  2. Run npx @halvorai/ingest init again with the live key. It registers a new source for production, with its own signing key.
  3. Set HALVOR_API_KEY and HALVOR_SOURCE_KEY in your production secrets.
  4. Send one real event and confirm it in the production dashboard.

Sources are per environment. A source registered in the sandbox cannot send production events.

Sandbox is safe to fill with traffic. You can use the validate endpoint to check events without storing them at all.