Configuration
Complete reference for all environment variables and startup settings.
Required Variables
Set these before the first cf restage. Without them the app will start but may behave incorrectly.
| Variable | | Description |
| FLASK_SECRET_KEY | optional | Session signing secret. Auto-generated on first boot and persisted locally — no manual setup needed. Only set this explicitly for multi-instance deployments that need shared sessions across instances. |
| HTTPS_ENABLED | required | Set to true on BTP Cloud Foundry (always HTTPS). Set to false for local Docker testing only. |
Licensing
| Variable | | Description |
| LICENSE_KEY | optional | Your license key from the LemonSqueezy email. Without it the app runs in 14-day trial mode. Validated directly against api.lemonsqueezy.com — no separate license server required. |
| LEMON_VARIANT_STARTER | optional | LemonSqueezy variant ID for the Starter plan. Used to determine tier from the purchase. Find in your LemonSqueezy product settings. |
| LEMON_VARIANT_PRO | optional | LemonSqueezy variant ID for the Professional plan. |
| LEMON_VARIANT_ENTERPRISE | optional | LemonSqueezy variant ID for the Enterprise plan. |
| LICENSE_OFFLINE | optional | Set to true to skip license validation entirely. Grants Enterprise-tier access. Dev / air-gapped only — never use in production. |
BTP Authentication (XSUAA)
These are set automatically when you bind the XSUAA service (cf bind-service). You do not set them manually.
| Variable | | Description |
| VCAP_SERVICES | auto | Injected by CF when services are bound. CPI Studio reads XSUAA credentials from here automatically. |
| XSUAA_DEFAULT_ROLE | optional | Role assigned to users who have no matching Role Collection. Options: admin / developer / viewer. Default: viewer. |
AI Features
| Variable | | Description |
| OPENAI_API_KEY | optional | Your OpenAI API key. Required to enable the AI assistant, code explanation, and script generation features (Pro/Enterprise tier only). |
| OPENAI_MODEL | optional | Model to use for AI features. Default: gpt-4o. Can be set to gpt-4o-mini to reduce API costs. |
| AI_MAX_TOKENS | optional | Maximum tokens per AI response. Default: 2048. |
Tenant & Connection Settings
Individual CPI tenants are configured through the UI (Settings → Tenant Profiles), not environment variables. However these globals apply:
| Variable | | Description |
| REQUEST_TIMEOUT | optional | Timeout in seconds for all CPI API calls. Default: 30. Increase for slow CPI tenants. |
| MAX_LOG_ROWS | optional | Maximum message log rows fetched per page. Default: 200. |
Storage
| Variable | | Description |
| DATA_DIR | optional | Directory for persistent data (tenant profiles, audit log, settings). Default: /app/data inside the container. Mount a CF volume service here to persist across restages. |
⚠ Persistence on CF: Cloud Foundry containers are ephemeral — data written to the filesystem is lost on restage. Tenant profiles and settings are stored in the running container. Use a CF volume service or store credentials only in environment variables for production deployments.
Full Example
# Minimum required — FLASK_SECRET_KEY is auto-generated on first boot
cf set-env cpi-developer-studio HTTPS_ENABLED "true"
cf set-env cpi-developer-studio LICENSE_KEY "XXXX-XXXX-XXXX-XXXX"
# Optional: AI assistant, XSUAA default role
cf set-env cpi-developer-studio OPENAI_API_KEY "sk-..."
cf set-env cpi-developer-studio XSUAA_DEFAULT_ROLE "viewer"
cf restage cpi-developer-studio