A Raycast extension that exposes Z.ai / BigModel GLM models to Raycast's built-in AI features — AI Chat, Quick AI, and AI Commands — using Raycast's extension AI model provider API.
api.z.ai) and BigModel China (open.bigmodel.cn) — switchable in preferencesRaycast 1.26.0 or newer, signed in with your Raycast account
Raycast Pro — Raycast requires a Pro subscription to use models provided by extensions
Node.js 22.22.2+ and npm 7+ (check with node -v — matches @raycast/api's own requirement, also declared in engines)
An API key:
Z.ai (pay-as-you-go) platform setting)BigModel (pay-as-you-go) setting)Keys are not interchangeable between the two platforms. Pay-as-you-go API keys only — GLM Coding Plan and Team Plan keys are not supported.
cd glm-models
npm install
npm run dev
Running npm run dev registers the extension locally in Raycast (it appears at the top of root search).
The first time Raycast needs the extension's settings, it shows a setup form asking for every required preference together — API Key and Platform — with a help page (from help.md) beside the form. Pick the platform that matches where your key was created; the two platforms' keys are not interchangeable.
| Preference | What to enter |
|---|---|
| API Key | Your Z.ai or BigModel key |
| Platform | Z.ai (pay-as-you-go) or BigModel (pay-as-you-go) — must match where the key came from. Pay-as-you-go keys only: GLM Coding Plan / Team Plan keys are not supported |
| Custom Base URL | Only if you picked Custom (any HTTPS OpenAI-compatible endpoint) |
| Extra Models | Optional comma-separated model IDs to force-include in the picker |
After the setup form, validate everything with the Check Setup command: it calls the live API with your saved key and platform and tells you exactly what's wrong if they don't match (401 → key/platform mismatch), the endpoint is unreachable, or all good (N models discovered). It can also test a different key/platform combination before you commit it to preferences — a combination that differs from the saved one is reported as validated, but not applied, since extensions cannot change their own preferences — and its Open Platform Console action deep-links to the selected platform's API-keys page (z.ai or open.bigmodel.cn). Validating the saved combination also refreshes Raycast's model list.
Then opt in to extension models (one-time):
glm-4.5-flash is free, a good first smoke testWhile developing, keep npm run dev running for hot reload. Press ⌃C to stop; the extension stays in Raycast. Re-run npm run dev after code changes.
The Refresh Models command validates the saved key + platform and re-runs model discovery in one step, reporting the outcome (e.g. "Z.ai (pay-as-you-go): 18 models available") — the one-step way to pick up a platform change from the settings (Raycast also refreshes automatically in the background, but it doesn't notify extensions when preferences change).
GET {baseURL}/models with your key to get the models your account can actually use (handles platform differences and new releases automatically)./models call fails, the models.dev model list is used instead; if that is unreachable too (e.g. first run offline), a small curated fallback keeps the picker populated: GLM-5.3, GLM-5.2, GLM-5.3-Flash, GLM-4.7, GLM-4.6, GLM-4.5-Flash.Notes:
reasoning_effort on GLM-5.x models, and to thinking on/off on GLM-4.x models (none disables thinking).reasoning-delta parts).AI_DownloadError: Cannot find module 'undici' when attaching an image — this happened in early versions of this extension: image attachments were converted to data: URLs, which the AI SDK tries to fetch, and that path requires the undici npm package which Raycast's runtime doesn't provide. Fixed by passing image bytes directly; if you see it again, run npm run dev so you're on the latest build.npm run dev console: it logs either glm-models: discovered N model ids via …/models (dynamic discovery worked) or glm-models: /models lookup failed … followed by which fallback list was used (models.dev or the curated catalog). Also confirm you toggled the extension on in Raycast Settings → AI.This repo is currently a personal extension. If you want to publish it:
npm run publish authenticates with GitHub)npm run build to validate for distributionnpm run publish — opens a pull request against the raycast/extensions repositorysrc/models.ts AI model provider entry point: getModels + streamCompletion
src/lib/catalog.ts Curated model metadata, /models discovery, preferences
src/check-setup.tsx Command: validate key + platform against the live API
src/refresh-models.ts Command: manually refresh the model list
npm run dev — run in development mode with hot reloadnpm run build — production build / store validationnpx tsc --noEmit — type checkThe provider uses @ai-sdk/openai-compatible + Vercel AI SDK streamText, pointed at Z.ai's OpenAI-compatible endpoint. Provider options under the zai namespace (thinking, reasoning_effort) are forwarded into the request body by the compatible provider.