Magic Mirror uses a dedicated Worker gateway instead of the old documentation gateway. The Worker exposes:
POST /api/sarmad/ask
and calls Cloudflare Workers AI through the AI binding.
Current deployed gateway:
https://magicmirror-sarmad-gateway.2sa.workers.dev
cd cloudflare\magicmirror-sarmad-gateway
wrangler deployor from the repository root:
.\scripts\deploy-gateway.ps1The default model is:
@cf/openai/gpt-oss-20b
Requests that still ask for the deprecated @cf/openai/gpt-oss-120b are
automatically migrated to @cf/openai/gpt-oss-20b by the gateway.
Set AI gateway base URL in Magic Mirror settings to the Worker URL, without
the /api/sarmad/ask suffix. Example:
https://magicmirror-sarmad-gateway.2sa.workers.dev
The native app will post to:
{GatewayBaseUrl}/api/sarmad/ask
No API keys are stored in this repository or in the native app. Cloudflare
Workers AI is accessed only through the server-side AI binding configured by
Wrangler.
If wrangler deploy returns Authentication error [code: 10000], refresh the
local Cloudflare OAuth session:
wrangler logout
wrangler login
.\scripts\deploy-gateway.ps1