glaze-byok-ai

glaze-byok-ai is a skill for Claude Code, Codex from GaimsDevSoftware/glaze-coder. It costs 112 tokens per session (4,524 once invoked), scanned A, original, MIT.

An AI-engine choice for Glaze desktop apps, letting users use Glaze AI, their own free API key, or the local Claude Code command-line tool.

In plain words
What is it for?
Use it when adding AI features to an app built with glaze-coder, including an engine picker, saved defaults, and fallback between supported AI providers.
Why use it?
It lets each user choose between convenience, free personal API access, and an existing Claude subscription. This avoids forcing every user to spend Glaze credits.

Skill for Claude CodeCodex

Part of the glaze-coder plugin — 2 skills, 1 command shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/gaimsdevsoftware/glaze-coder/glaze-byok-ai
Any agent
npx skills add GaimsDevSoftware/glaze-coder --skill glaze-byok-ai
Clone the repo
git clone --depth 1 https://github.com/GaimsDevSoftware/glaze-coder

Made for: Claude Code, Codex.

Or install glaze-coder, the plugin that ships this one along with the rest of its 2 skills, 1 command.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for glaze-byok-ai

README.md
[![agentmods](https://agentmods.dev/badge/skills/gaimsdevsoftware/glaze-coder/glaze-byok-ai.svg)](https://agentmods.dev/skills/gaimsdevsoftware/glaze-coder/glaze-byok-ai)
Your own site
<a href="https://agentmods.dev/skills/gaimsdevsoftware/glaze-coder/glaze-byok-ai"><img src="https://agentmods.dev/badge/skills/gaimsdevsoftware/glaze-coder/glaze-byok-ai.svg" alt="Measured on agentmods" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,524 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00112 $0.04524
Opus 5 $0.00056 $0.02262
Sonnet 5 $0.00022 $0.00905
Haiku 4.5 $0.00011 $0.00452

Measured 3d ago against content hash 3f56ff22b282, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

glaze-byok-ai scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/glaze-coder/skills/glaze-byok-ai/SKILL.md · 328 lines

How it starts

The opening of the file, as written. The whole thing — 328 lines — stays where its author put it; the contents beside it link to each section on GitHub.

User-selectable AI engine for Glaze apps (Glaze AI or BYOK)

Before scaffolding, read the developer's saved policy if present: ~/.config/glaze-coder/defaults.json with {"aiDefault": "glaze" | "byok-fallback" | "byok-first"} (written by the Free Coder for Glaze onboarding app). byok-fallback = Glaze default + auto-fallback on (this skill's default); byok-first = scaffold with a free engine as the app's default provider and Glaze never running unasked; glaze = built-in AI only, skip the engine picker. A missing file means byok-fallback.

Default policy for apps built with glaze-coder: when an app calls AI, the end user gets to pick the engine. Glaze AI works with zero setup but spends the user's Glaze credits; a bring-your-own-key engine is free for them (Gemini has a real free tier); the local Claude Code CLI is free for users who already pay for a Claude subscription. Implement this choice unless the user building the app explicitly wants Glaze-only.

Reference implementation: the News Flow app (ai-provider.ts + claude-cli.ts + "AI-motor" settings section + onboarding engine step). This file contains everything needed to reproduce it in any app.

The four engines

Engine Cost for the user Setup Notes
glaze (default) Glaze credits none Always the default and the fallback
gemini free paste a free AI Studio key ~250 calls/day free tier; recommended free option
openrouter free paste an OpenRouter key ~50 calls/day unfunded; openrouter/free auto-routes; optional third choice
claude free with a Claude subscription Claude Code installed + logged in For users known to have Claude Code; settings-only, slower (seconds to a minute per call)

Rules that keep this correct and honest:

  • Glaze stays the default. A missing or invalid BYOK key must silently fall back to Glaze AI, never break the feature.
  • Keep glaze.capabilities.ai declared in package.json (grades matching the code), since Glaze remains default + fallback. Publish rejects AI apps without it.
  • Keys are encrypted with safeStorage, stored in userData, and never sent to the renderer. Only boolean hasKey flags cross IPC.
  • Key links: Gemini keys at https://aistudio.google.com/apikey, OpenRouter keys at https://openrouter.ai/settings/keys. Open via shell.openExternal. Automatic key provisioning is not possible; a deep link plus paste field is the simplest flow.
  • The "Test" button makes one tiny generateText call against the user's own key, only when clicked. Never run it (or any AI call) yourself during verification; verify with type-check and build only.
  • Do not put pricing copy next to AI controls beyond the engine descriptions; Glaze's own consent UI explains credits.
  • The Claude engine spawns the user's own claude CLI (subscription login). Never collect Anthropic API keys, OAuth tokens, or Claude credential files for it, and never persist CLAUDE_CODE_OAUTH_TOKEN. Offer it to audiences known to have Claude Code; keep it in full settings, not onboarding. Detection gates the UI state (a found/not-found badge), and a missing CLI falls back to Glaze like a missing key.

Read the full file on GitHub · 328 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 328 lines · 112 tokens per session scan A 3f56ff22b282

Subscribe to this mod's changes

glaze-byok-ai is a skill published in the GitHub repository GaimsDevSoftware/glaze-coder (8 stars, last pushed 14d ago), licensed MIT. It adds 112 tokens to every session and 4,524 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.