Overview
Open Higgsfield AI uses Muapi.ai as its API provider for accessing 20+ AI models. This guide walks you through obtaining, configuring, and securing your API key.Getting a Muapi.ai API Key
Create an Account
Visit https://muapi.ai and sign up for an account.
Generate a New Key
Click “Create API Key” and give it a descriptive name (e.g., “Open Higgsfield AI”).
Configuring the API Key in Open Higgsfield AI
In the App Interface
Storage Location
The API key is stored locally in your browser usinglocalStorage:
Your API key is stored only in your browser and never sent to any server except Muapi.ai when making generation requests.
How API Integration Works
API Client Architecture
Open Higgsfield AI uses theMuapiClient class to handle all API communication:
Request Flow
User Initiates Generation
You enter a prompt and click “Generate” in Image Studio, Video Studio, or Cinema Studio.
Timeout Settings
CORS and Proxy Configuration
During development, Vite proxies API requests to avoid CORS issues:In Development: Requests go to
http://localhost:5173/api → proxied to https://api.muapi.aiIn Production: Requests go directly to https://api.muapi.aiAPI Key Security Best Practices
Environment Variables (For Self-Hosting)
If self-hosting, consider using environment variables:.env.local to your .gitignore:
Troubleshooting API Issues
Error: API Key missing. Please set it in Settings.
Error: API Key missing. Please set it in Settings.
Cause: No API key found in localStorage.Solution:
- Open Settings modal
- Enter your Muapi.ai API key
- Click Save
- Refresh the page and try again
muapi.js:10-13Error: API Request Failed: 401 Unauthorized
Error: API Request Failed: 401 Unauthorized
Error: Generation timed out after polling
Error: Generation timed out after polling
Cause: API took longer than 2-4 minutes to complete.Solution:
- Try a faster model (e.g., Flux Schnell)
- Check Muapi.ai status page for outages
- Reduce image resolution or video duration
muapi.js:165Error: Poll Failed: 429 Rate Limit Exceeded
Error: Poll Failed: 429 Rate Limit Exceeded
Cause: Too many requests in a short time.Solution:
- Wait 60 seconds before retrying
- Check your Muapi.ai plan limits
- Reduce concurrent generation requests
muapi.js:136-143CORS Error in Browser Console
CORS Error in Browser Console
Cause: Production build missing CORS headers (should not happen with proper deployment).Solution:
- In development: Restart Vite dev server
- In production: Verify API requests go directly to
api.muapi.ai - Check browser DevTools Network tab for actual error
vite.config.js:8-16Error: File upload failed
Error: File upload failed
Cause: Issue uploading reference images for Image-to-Image or Image-to-Video.Solution:
- Check file size (usually < 10MB)
- Verify file format (JPG, PNG, WebP)
- Ensure stable internet connection
muapi.js:362-388Monitoring API Usage
Track your API usage and costs on the Muapi.ai Dashboard:
- Request history
- Credit balance
- Per-model costs
- Billing details
API Rate Limits
Muapi.ai enforces rate limits based on your plan:- Free Plan: Lower concurrency, daily credit limit
- Pro Plan: Higher concurrency, pay-as-you-go credits
Next Steps
Model Selection
Choose the right model for your needs
Self-Hosting Guide
Deploy Open Higgsfield AI to production
