Open Generative AI is deliberately lightweight on server-side configuration — there are no secrets to manage inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/anil-matcha/open-generative-ai/llms.txt
Use this file to discover all available pages before exploring further.
.env files and no API credentials to bake into your Docker image. The one required piece of configuration, your Muapi.ai API key, lives entirely in the browser and is never stored on the server. The handful of environment variables that do exist control runtime behaviour of the Next.js server and the optional local inference engine.
API Key
Open Generative AI connects to Muapi.ai to run all cloud-based image and video generation models. You will need a free Muapi API key to use those features.Obtain your API key
Visit https://muapi.ai/access-keys and generate a new key. Copy the key value itself — not the key name or label.
Enter the key in the app
On first launch, Open Generative AI shows an API Key modal (
ApiKeyModal.js). Paste your key and confirm. The key is immediately saved to browser localStorage under the key name muapi_key and the modal will not appear again.How the key is used
Every request to Muapi.ai is authenticated by sending the key in thex-api-key HTTP header:
localStorage by the studio components on the client side. It is never forwarded to your self-hosted server, never written to a server-side config file, and never sent to any host other than api.muapi.ai.
Programmatic and automation use
When driving the app through browser automation (Puppeteer, Playwright, Cypress) or seeding it in a development environment, you can pre-populate the key by writing tolocalStorage before the page loads:
localStorage.getItem('muapi_key') on every generation request, so setting this value before any API call is made is sufficient.
Environment Variables
These variables are read at server startup or build time. None of them are required for basic operation.OPEN_GENERATIVE_AI_LOCAL_AI_DIR
OPEN_GENERATIVE_AI_LOCAL_AI_DIR
Overrides the directory where the local AI engine (
The app creates three sub-directories inside this location on first use: Settings → Local Models in the desktop app shows the resolved model folder so you can confirm the override took effect.
sd.cpp) stores its binary, model weights, and temporary download files. By default the app resolves a platform-appropriate path under the OS application-data directory:| Platform | Default path |
|---|---|
| macOS | ~/Library/Application Support/open-generative-ai/local-ai |
| Windows | %APPDATA%\open-generative-ai\local-ai |
| Linux | ~/.config/open-generative-ai/local-ai |
bin/ (the sd-cli binary and its shared library), models/ (downloaded model weights), and tmp/ (in-progress downloads).Set this variable before launching the desktop app if you want to keep multi-gigabyte model weights on a second drive:This variable applies only to the desktop (Electron) app. It has no effect on self-hosted web deployments because local inference is not available in the web version.
NODE_ENV
NODE_ENV
Standard Node.js environment flag consumed by Next.js.
The When running the production build manually, set it in your shell:
| Value | When to use |
|---|---|
development | Local development (npm run dev). Enables hot-reload, verbose error pages, and React development mode. |
production | Running the compiled Next.js server (npm run start) or inside the Docker container. Enables output caching, minification, and React production mode. |
docker-compose.yml sets NODE_ENV=production automatically:Local Models Settings (Desktop App)
Local inference is configured entirely inside the app — there are no config files to edit. Open Settings → Local Models in the desktop app to access:- sd.cpp inference engine — one-click install. The engine binary (
sd-cli) and its shared library are downloaded and placed in thebin/sub-directory of your local-AI data directory. Once installed, the ⚡ Local toggle appears next to the model selector in Image Studio. - Model downloads — each supported model (Dreamshaper 8, Realistic Vision v5.1, Anything v5, SDXL Base 1.0, Z-Image Turbo, Z-Image Base) can be downloaded individually. Z-Image models share auxiliary files (Qwen3-4B Text Encoder and FLUX VAE) that are downloaded once.
- Wan2GP server URL — paste the HTTP address of your running Wan2GP Gradio server (e.g.
http://192.168.1.42:7860), click Test, then Save. Wan2GP models become available for image and video generation once the connection succeeds.
Local inference (sd.cpp and Wan2GP) is available only in the desktop app. Self-hosted web deployments always route generation requests through the Muapi.ai cloud API.
API Proxy Configuration
Open Generative AI avoids CORS issues with two different strategies depending on the runtime environment. Web / Next.js mode — Requests originating in the browser are sent to the Next.js server’s own/api/* routes. Those server-side routes re-issue the request to https://api.muapi.ai and stream the response back. This is configured as a catch-all route in the app and means the browser never makes a cross-origin request directly. The decision is made automatically in muapi.js:
file:// origin, so the window.location.protocol check resolves to file: and BASE_URL is set to https://api.muapi.ai directly. No proxy is involved.
Vite dev server — During Electron development (npm run electron:dev), Vite proxies /api → https://api.muapi.ai via vite.config.mjs:
