No API Keys Β· No Limits Β· No Cost
Hermes Agent + Meta AI (Muse Spark) + Go API + React 19 Frontend
Same Meta AI model, responding on Telegram, WhatsApp & Web β all from your own server
π Ψ§ΩΨΉΨ±Ψ¨ΩΨ© β Ψ§ΩΨ±Ψ£ Ψ§ΩΨͺΩΨ«ΩΩ Ψ§ΩΨΉΨ±Ψ¨Ω
π‘ What is this? A self-hosted Go API that wraps Meta AI (powered by Muse Spark) into an OpenAI-compatible endpoint. Connect it to Hermes Agent and chat with Meta's LLM for free from Telegram, WhatsApp, or any messaging platform β no API key required.
β Enjoying this project? Star it on GitHub to support us!
If this project saved you money on AI API costs or made your life easier, a β star is the best way to say thanks! It helps others discover it too.
Warning
Educational Purposes Only: This project is created strictly for educational, research, and development purposes. It is an unofficial integration and should not be used in commercial production environments without respecting Meta's official guidelines and terms of service.
π― Project Overview β’ ποΈ Architecture β’ π Install with Hermes Agent β’ π¦ Prerequisites β’ π Cookie Setup β’ π Running Modes β’ π§ REST API
- smart-studio: A modern marketing and design interface (React 19) offering 11 specialized studios for branding, photography, video, voiceovers, campaigns, and market analysis.
- metaai-go: A high-performance Go API wrapper for Meta AI. It intercepts requests from SMART Studio and interacts directly with Meta AI using cookie authentication.
Note
Integration Details:
Every AI call in SMART Studio routes through a central service (smart-studio/services/geminiService.ts which re-exports from aiService.ts), communicating directly with the metaai-go REST API.
| Studio / Feature | Description | Engine | Status |
|---|---|---|---|
| π¬ Intelligent Chat | Powered by Muse Spark with real-time Bing search | Meta AI | β Working |
| π¨ Creator Studio | Generate product images in custom orientations | Meta AI | β Working |
| π¬ Video Studio | Generate cinematic videos from text/image references | Meta AI | β Working |
| π Image Analysis | Describe, extract prompts, and audit brand aesthetics | Meta AI | β Working |
| π’ Plan Studio | Generate 9-post campaigns localized in Egyptian colloquial Arabic | Meta AI | β Working |
| π¨ Branding Studio | Generate logo variations and extract brand colors | Meta AI | β Working |
| π£οΈ Voice Over Studio | Text-to-Speech (TTS) conversion | Gemini | πΆ Requires API Key |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser (SMART Studio React SPA) β
β β
β components/*.tsx ββimportsβββΆ services/geminiService.ts β
β (11 studios) β β
β βΌ (re-export shim) β
β services/aiService.ts β
β β β
β βΌ β
β services/metaaiClient.ts β
β (single network layer: fetch + Bearer) β
ββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β HTTPS / same-origin
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β metaai-go REST Server (Go binary) β
β β
β /chat /analyze /upload /image /image/fetch /video* β
β rest/handlers.go rest/analyze_handler.go β
β β
β + embedded SMART Studio SPA at / (in prod build) β
ββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β WebSocket + GraphQL
β (cookies + access token)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Meta AI (meta.ai) β
β - generated images on scontent-arn2-1.xx.fbcdn.net β
β - generated videos on video-*.xx.fbcdn.net β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
This section explains how to install and connect this project to Hermes Agent so you can use Meta AI as a free LLM provider inside Hermes on Telegram, WhatsApp, Discord, or any platform Hermes supports.
Important
You need a server/VPS with a public IP (Linux, Mac, or Windows). Hermes Agent connects to your server over the network β it doesn't run the Go binary locally.
ββββββββββββββββ HTTPS ββββββββββββββββββββββββ WebSocket ββββββββββββ
β Hermes Agent β ββββββββββββββΊ β metaai-go Server β ββββββββββββββββββΊ β Meta AI β
β (any device) β :8787/v1 β (your VPS/server) β cookies+token β meta.ai β
β Telegram/WA β β OpenAI-compatible β β β
ββββββββββββββββ ββββββββββββββββββββββββ ββββββββββββ
Hermes Agent talks to metaai-go using the OpenAI-compatible proxy (/v1/chat/completions). This means Hermes treats Meta AI as just another LLM provider.
π§ Linux (Ubuntu/Debian)
# Install Go 1.21+
sudo apt update
sudo apt install -y golang-go build-essential
# Install Node.js 18+ (via NodeSource)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
# Verify
go version # go1.21+
node -v # v18+
npm -v # 9+π macOS
# Install via Homebrew
brew install go node
# Verify
go version # go1.21+
node -v # v18+
npm -v # 9+πͺ Windows
# Install Go: download from https://go.dev/dl/ (Windows .msi installer)
# Install Node.js: download from https://nodejs.org/ (LTS .msi installer)
# Or via Chocolatey/Winget:
winget install GoLang.Go
winget install OpenJS.NodeJS.LTS
# Verify (in PowerShell or CMD)
go version
node -v
npm -v[!NOTE] Windows users: The
makecommands below may not work natively. You can either:
- Use WSL2 (Windows Subsystem for Linux) β recommended, full Linux experience
- Use Git Bash (comes with Git for Windows)
- Replace
make run-restwithgo run ./cmd/metaai-restetc.
# Clone the repository
git clone https://github.com/compnew2006/MetaAI-Free-Hermes-Agent.git
cd MetaAI-Free-Hermes-Agent
# Create the backend .env with your Meta AI cookies
cd metaai-go
cp .env.example .env
nano .env # or: code .env (VS Code) or: notepad .env (Windows)Fill in your Meta AI cookies (see Cookie Setup section below for how to get them):
META_AI_DATR=your_datr_cookie_here
META_AI_ECTO_1_SESS=your_ecto_1_sess_cookie_here
META_AI_ACCESS_TOKEN=ecto1:your_access_token_here
META_AI_RD_CHALLENGE=your_rd_challenge_cookie
# Proxy server config (this is what Hermes connects to)
META_AI_PROXY_ADDR=:8787
META_AI_PROXY_TOKEN=your-secret-api-keyOption A: Development (with hot-reload)
cd metaai-go
make run-rest # REST API on :8000
# In another terminal β start the OpenAI-compatible proxy on :8787
cd metaai-go
go run ./cmd/metaai-server -addr :8787 -token "your-secret-api-key"Option B: Production (background)
cd metaai-go
# Build the proxy server binary
go build -o metaai-proxy ./cmd/metaai-server
# Run in background
nohup ./metaai-proxy -addr :8787 -token "your-secret-api-key" > proxy.log 2>&1 &
# Verify it's running
curl http://localhost:8787/v1/modelsOption C: systemd service (Linux only β recommended for VPS)
sudo tee /etc/systemd/system/metaai-proxy.service > /dev/null << 'EOF'
[Unit]
Description=MetaAI Proxy (OpenAI-compatible)
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/path/to/MetaAI-Free-Hermes-Agent/metaai-go
ExecStart=/path/to/MetaAI-Free-Hermes-Agent/metaai-go/metaai-proxy -addr :8787 -token "your-secret-api-key"
Restart=always
RestartSec=5
EnvironmentFile=/path/to/MetaAI-Free-Hermes-Agent/metaai-go/.env
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable metaai-proxy
sudo systemctl start metaai-proxy
sudo systemctl status metaai-proxyNow configure Hermes Agent to use your Meta AI server as a custom LLM provider.
Open Hermes config file (~/.hermes/config.yaml) and add/modify:
# Custom provider β point to your MetaAI proxy server
custom_providers:
- name: smart-studio
models:
meta-ai:
supports_vision: true
meta-ai-analyze:
supports_vision: true
# Register the provider with base URL and API key
providers:
smart-studio:
base_url: http://YOUR_SERVER_IP:8787/v1
api_key: your-secret-api-key # Same as META_AI_PROXY_TOKEN
# (Optional) Use Meta AI as default model
model:
default: meta-ai
provider: smart-studioTip
- Replace
YOUR_SERVER_IPwith your VPS public IP (e.g.http://123.45.67.89:8787/v1) - If Hermes runs on the same machine as the proxy, use
http://localhost:8787/v1 - If you're behind NAT/firewall, you may need to port-forward
8787or use a reverse proxy (nginx/Caddy) - For HTTPS, put a reverse proxy (nginx + Let's Encrypt) in front of
:8787
# Test the proxy directly
curl http://localhost:8787/v1/chat/completions \
-H "Authorization: Bearer your-secret-api-key" \
-H "Content-Type: application/json" \
-d '{"model":"meta-ai","messages":[{"role":"user","content":"Hello!"}]}'
# Start or restart Hermes
hermes start
# Chat with Meta AI on Telegram, WhatsApp, or any connected platform!β Can I run this on Windows without a server?
Yes! You can run everything locally on Windows:
- Install Go and Node.js
- Clone this repo and run the proxy:
go run ./cmd/metaai-server -addr :8787 -token "my-token" - Install Hermes Agent on Windows and set
base_url: http://localhost:8787/v1
Note: Hermes Agent officially supports Linux/macOS. For Windows, use WSL2 for the best experience. Hermes can connect to a Windows-hosted proxy via
http://YOUR_WINDOWS_IP:8787/v1.
β How do I make it accessible over the internet?
If your Hermes Agent is on a different machine than the proxy:
- VPS (easiest): Deploy the proxy on a VPS with public IP β Hermes connects to
http://VPS_IP:8787/v1 - Home server + NAT: Port-forward
8787on your router β use your public IP or DDNS - Cloudflare Tunnel (free, no port forwarding):
cloudflared tunnel --url http://localhost:8787 # Then use the tunnel URL as base_url in Hermes - Tailscale (VPN mesh): Install Tailscale on both machines β use the Tailscale IP
β My cookies expired β what do I do?
ecto_1_sess expires periodically. When it does:
- Go to meta.ai in your browser
- Open DevTools β Application β Cookies β copy the new
ecto_1_sess - Update your
.envfile and restart the proxy
| Tool | Version | Purpose |
|---|---|---|
| Go | 1.21+ | Run and compile the metaai-go backend |
| Node.js | 18+ | Package installation and building for smart-studio |
| npm | 9+ | Package manager for smart-studio and Go UI dependencies |
| Meta AI Account | - | Free logged-in account at meta.ai |
To authenticate with Meta AI without API keys, you must extract cookies from your logged-in browser session.
- Go to meta.ai in your browser and sign in.
- Open DevTools (F12 or right-click β Inspect).
- Navigate to the Application tab β Storage β Cookies β
https://www.meta.ai. - Copy values for the following cookies:
datr(Required - long-lived device token)ecto_1_sess(Required - session token, expires periodically)rd_challenge(Recommended - bypasses regional verification blocks)abra_sess(Optional - improves compatibility in some regions)
Create a .env file inside the metaai-go directory:
META_AI_DATR=your_datr_cookie_here
META_AI_ECTO_1_SESS=your_ecto_1_sess_cookie_here
# Recommended Config
META_AI_RD_CHALLENGE=your_rd_challenge_cookie
META_AI_DPR=1
META_AI_WD=1837x1240
META_AI_PS_L=1
META_AI_PS_N=1
# Optional Server Config
META_AI_REST_ADDR=:8000
META_AI_REST_TOKEN=smart-studio-dev-token
META_AI_CORS_ORIGIN=http://localhost:3000Create a .env file inside the smart-studio directory:
VITE_METAAI_URL=http://localhost:8000
VITE_METAAI_TOKEN=smart-studio-dev-token
GEMINI_API_KEY=your_gemini_api_key_here # Only required for Voice Over Studio (TTS)Starts Vite HMR dev server for the frontend, and standard API server for the backend.
# Start backend on :8000
cd metaai-go
make run-rest
# In a new terminal: Start frontend on :3000
cd smart-studio
npm install
npm run devAlternatively, if you have air installed, run both with a single command:
cd metaai-go
make run-devCombines SMART Studio frontend and Go backend into a single executable binary.
cd metaai-go
make build-prod
# Run the unified server (accessible at http://localhost:8000)
META_AI_REST_TOKEN=smart-studio-dev-token ./bin/metaai-restcd metaai-go
go build -o /tmp/metaai-rest ./cmd/metaai-rest
nohup /tmp/metaai-rest > /tmp/metaai-rest.log 2>&1 &
# Follow logs
tail -f /tmp/metaai-rest.logAll requests must include the REST Token as a Bearer Auth header:
Authorization: Bearer <META_...KEN>
| Endpoint | Method | Description | Status |
|---|---|---|---|
/healthz |
GET | Health check (No Auth) | β Working |
/chat |
POST | Send messages to Muse Spark | β Working |
/upload |
POST | Upload reference images (multipart form-data) | β Working |
/analyze |
POST | Analyze uploaded images | β Working |
/image |
POST | Generate images from prompts | β Working |
/image/fetch |
GET | Fetch fbcdn image URL and convert to Base64 | β Working |
/video/async |
POST | Start asynchronous video generation | β Working |
/video/jobs/{id} |
GET | Poll status of asynchronous video job | β Working |
curl -X POST http://localhost:8000/image \
-H "Authorization: Bearer smart-...ken" \
-H "Content-Type: application/json" \
-d '{"prompt": "Cyberpunk cityscape at night", "orientation": "LANDSCAPE"}'MetaAI-Free-Hermes-Agent/
β
βββ π smart-studio/ # React 19 Frontend Web App
β βββ π components/ # 11 Marketing Studios UI
β βββ π services/ # AI Client and routing services
β βββ π package.json # Dependencies & Scripts
β
βββ π metaai-go/ # Go Backend API Wrapper
β βββ π cmd/ # Entrypoints (metaai-rest, metaai-server)
β β βββ π metaai-rest # REST API server (SMART Studio backend)
β β βββ π metaai-server # OpenAI-compatible proxy (for Hermes Agent)
β βββ π rest/ # REST API Router & Handler logic
β βββ π proxy/ # OpenAI/Anthropic-compatible proxy layer
β βββ π ui/ # Embedded administration console
β βββ π Makefile # Build pipeline commands
β βββ π go.mod # Go modules dependency declaration
β
βββ π README.md # English documentation
βββ π README.ar.md # Arabic documentation
βββ π LICENSE
This project is licensed under the MIT License - see LICENSE for details.
This project is an independent implementation and is not officially affiliated with Meta Platforms, Inc. or any of its affiliates.
- β Educational and development purposes
- β Use responsibly and ethically
- β Comply with Meta's Terms of Service
- β Respect usage limits and policies
Muse Spark License: Visit llama.com/muse-spark for Muse Spark usage terms.