Environment variables
The SDK reads these env vars at Client(...) / AsyncClient(...)
construction. Explicit constructor arguments always win over env vars.
| Name | Read by | Default | Description |
|---|---|---|---|
DREAM_API_KEY | Client, AsyncClient | none | bearer token (dre_<43-char>) |
DREAM_ENGINE_API_KEY | Client, AsyncClient | none | legacy alias for DREAM_API_KEY (used as fallback) |
DREAM_BASE_URL | Client, AsyncClient | https://api.dreamengines.run | full URL of the engine's HTTP gateway |
DREAM_LIVE_TESTS | pytest | unset | 1 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.