Dream Engines

Environment variables

The SDK reads these env vars at Client(...) / AsyncClient(...) construction. Explicit constructor arguments always win over env vars.

NameRead byDefaultDescription
DREAM_API_KEYClient, AsyncClientnonebearer token (dre_<43-char>)
DREAM_ENGINE_API_KEYClient, AsyncClientnonelegacy alias for DREAM_API_KEY (used as fallback)
DREAM_BASE_URLClient, AsyncClienthttps://api.dreamengines.runfull URL of the engine's HTTP gateway
DREAM_LIVE_TESTSpytestunset1 enables the live-against-staging test suite

Resolution order — api_key

explicit api_key= argument
└─ DREAM_API_KEY env
   └─ DREAM_ENGINE_API_KEY env       (legacy)
      └─ no auth header              (no-auth dev mode only)

If you reach the no-auth fallback in production, the server will reject your request with dream.AuthError.

Resolution order — base_url

explicit base_url= argument
└─ DREAM_BASE_URL env
   └─ https://api.dreamengines.run       (production default)

Trailing slash is stripped. Pass a custom URL when hitting a Modal deployment directly:

BASH
export DREAM_BASE_URL="https://<workspace>--dreamengine-serve-…modal.run"

Other environment

The SDK does not read HF_TOKEN, STRIPE_API_KEY, or anything else. Those are server-side secrets — set on the Modal deployment, not on the client.

mediapy (the optional decode dep) may read FFMPEG_PATH / PATH to locate ffmpeg. If rollout.frames raises a "ffmpeg not found" error, install ffmpeg on the host or pre-encode your inputs yourself.