Skip to main content

Documentation 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.

Open Generative AI is deliberately lightweight on server-side configuration — there are no secrets to manage in .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.
1

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.
2

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.
3

Update or rotate the key

Click the key icon in the top navigation (StandaloneShell.js) at any time to open the modal again and replace the stored value.

How the key is used

Every request to Muapi.ai is authenticated by sending the key in the x-api-key HTTP header:
POST /api/v1/flux-dev HTTP/1.1
x-api-key: <your-key>
Content-Type: application/json
The key is read directly from 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 to localStorage before the page loads:
// Playwright / Puppeteer
await page.evaluate(() => {
  localStorage.setItem('muapi_key', 'YOUR_KEY_HERE');
});
The app reads 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.
Overrides the directory where the local AI engine (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:
PlatformDefault path
macOS~/Library/Application Support/open-generative-ai/local-ai
Windows%APPDATA%\open-generative-ai\local-ai
Linux~/.config/open-generative-ai/local-ai
The app creates three sub-directories inside this location on first use: 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:
# macOS / Linux
export OPEN_GENERATIVE_AI_LOCAL_AI_DIR="/Volumes/ExternalSSD/local-ai"
open "/Applications/Open Generative AI.app"

# Windows PowerShell
$env:OPEN_GENERATIVE_AI_LOCAL_AI_DIR = "D:\local-ai"
Start-Process "Open Generative AI.exe"
Settings → Local Models in the desktop app shows the resolved model folder so you can confirm the override took effect.
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.
Standard Node.js environment flag consumed by Next.js.
ValueWhen to use
developmentLocal development (npm run dev). Enables hot-reload, verbose error pages, and React development mode.
productionRunning the compiled Next.js server (npm run start) or inside the Docker container. Enables output caching, minification, and React production mode.
The docker-compose.yml sets NODE_ENV=production automatically:
environment:
  - NODE_ENV=production
When running the production build manually, set it in your shell:
NODE_ENV=production npm run start

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 the bin/ 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:
// packages/studio/src/muapi.js
const BASE_URL = (typeof window !== 'undefined' && window.location?.protocol?.startsWith('http'))
    ? '/api'
    : 'https://api.muapi.ai';
Electron / desktop mode — The renderer runs under a 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 /apihttps://api.muapi.ai via vite.config.mjs:
// vite.config.mjs
server: {
  proxy: {
    '/api': {
      target: 'https://api.muapi.ai',
      changeOrigin: true,
      secure: false
    }
  }
}

Build docs developers (and LLMs) love