Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.
docs: document the openai provider, the billed knobs and the subscription-first rule
Soohong Kim8163d9e1a7db
diff --git a/README.es.md b/README.es.mdindex a655493..70606ba 100644--- a/README.es.md+++ b/README.es.md@@ -155,7 +155,7 @@ python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-githu--repo aldegad/sprite-gen --path . --name sprite-gen```-La generación de imágenes forma parte de este motor (`sprite_gen.gen`, proveedores `codex` y `grok`; la skill genérica `image-gen` es una fina lanzadera sobre él). El vídeo usa **tu propia** credencial — el login de la CLI `grok` o una `XAI_API_KEY` — y nada se distribuye con el repositorio ([docs/video.md](docs/video.md)).+La generación de imágenes forma parte de este motor (`sprite_gen.gen`, proveedores `codex` y `grok` sobre una suscripción que ya pagas, más un proveedor `openai` para servidores y SaaS, facturado por llamada y que solo se ejecuta si lo nombras explícitamente; la skill genérica `image-gen` es una fina lanzadera sobre él). El vídeo usa **tu propia** credencial — el login de la CLI `grok` o una `XAI_API_KEY` — y nada se distribuye con el repositorio ([docs/video.md](docs/video.md)).`sprite-gen` soporta CPython 3.10+; CI ejecuta 3.10 y 3.14. El inicio rápido necesita un Python con `venv`/`ensurepip` funcionando.diff --git a/README.fr.md b/README.fr.mdindex 949f0d5..714165f 100644--- a/README.fr.md+++ b/README.fr.md@@ -155,7 +155,7 @@ python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-githu--repo aldegad/sprite-gen --path . --name sprite-gen```-La génération d'images fait partie de ce moteur (`sprite_gen.gen`, providers `codex` et `grok` ; la skill générique `image-gen` n'en est qu'une fine navette). La vidéo utilise **vos propres** identifiants — la connexion via la CLI `grok` ou une `XAI_API_KEY` — et rien n'est livré avec le dépôt ([docs/video.md](docs/video.md)).+La génération d'images fait partie de ce moteur (`sprite_gen.gen`, providers `codex` et `grok` sur un abonnement que vous payez déjà, plus un provider `openai` pour les serveurs et le SaaS, facturé à l'appel et lancé uniquement s'il est nommé explicitement ; la skill générique `image-gen` n'en est qu'une fine navette). La vidéo utilise **vos propres** identifiants — la connexion via la CLI `grok` ou une `XAI_API_KEY` — et rien n'est livré avec le dépôt ([docs/video.md](docs/video.md)).`sprite-gen` supporte CPython 3.10+ ; la CI tourne sur 3.10 et 3.14. Le démarrage rapide nécessite un Python avec `venv`/`ensurepip` fonctionnels.diff --git a/README.ja.md b/README.ja.mdindex 216baa8..dcfeb30 100644--- a/README.ja.md+++ b/README.ja.md@@ -155,7 +155,7 @@ python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-githu--repo aldegad/sprite-gen --path . --name sprite-gen```-画像生成はこのエンジンの一部です(`sprite_gen.gen`、プロバイダは `codex` と `grok`。汎用の `image-gen` スキルはその上の薄いシャトルです)。動画には**あなた自身の**認証情報 — `grok` CLI ログインまたは `XAI_API_KEY` — を使い、リポジトリには何も同梱されていません([docs/video.md](docs/video.md))。+画像生成はこのエンジンの一部です(`sprite_gen.gen`、すでに契約しているサブスクリプションで動くプロバイダ `codex` と `grok`、さらにサーバーや SaaS 向けに呼び出しごとに課金され、明示的に指定したときだけ動く `openai` プロバイダ。汎用の `image-gen` スキルはその上の薄いシャトルです)。動画には**あなた自身の**認証情報 — `grok` CLI ログインまたは `XAI_API_KEY` — を使い、リポジトリには何も同梱されていません([docs/video.md](docs/video.md))。`sprite-gen` は CPython 3.10+ をサポートし、CI は 3.10 と 3.14 で実行されます。クイックスタートには `venv`/`ensurepip` が動作する Python が必要です。diff --git a/README.ko.md b/README.ko.mdindex b3b4351..4ae290c 100644--- a/README.ko.md+++ b/README.ko.md@@ -155,7 +155,7 @@ python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-githu--repo aldegad/sprite-gen --path . --name sprite-gen```-이미지 생성은 이 엔진의 일부다 (`sprite_gen.gen`, 프로바이더 `codex` 와 `grok`; 범용 `image-gen` 스킬은 그 위에 얹힌 얇은 셔틀이다). 비디오는 **본인의** 자격 증명 — `grok` CLI 로그인 또는 `XAI_API_KEY` — 을 사용하며, 레포에는 아무것도 함께 배포되지 않는다 ([docs/video.md](docs/video.md)).+이미지 생성은 이 엔진의 일부다 (`sprite_gen.gen`, 이미 내고 있는 구독으로 도는 프로바이더 `codex` 와 `grok`, 그리고 서버·SaaS 용으로 호출당 과금되며 명시해야만 도는 `openai` 프로바이더; 범용 `image-gen` 스킬은 그 위에 얹힌 얇은 셔틀이다). 비디오는 **본인의** 자격 증명 — `grok` CLI 로그인 또는 `XAI_API_KEY` — 을 사용하며, 레포에는 아무것도 함께 배포되지 않는다 ([docs/video.md](docs/video.md)).`sprite-gen` 은 CPython 3.10+ 를 지원하고, CI 는 3.10 과 3.14 에서 돈다. 퀵스타트에는 `venv`/`ensurepip` 이 동작하는 Python 이 필요하다.diff --git a/README.md b/README.mdindex 0fd07fa..b07141c 100644--- a/README.md+++ b/README.md@@ -155,7 +155,7 @@ python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-githu--repo aldegad/sprite-gen --path . --name sprite-gen```-Image generation is part of this engine (`sprite_gen.gen`, providers `codex` and `grok`; the general `image-gen` skill is a thin shuttle over it). Video uses **your own** credential — the `grok` CLI login or an `XAI_API_KEY` — and nothing is shipped with the repo ([docs/video.md](docs/video.md)).+Image generation is part of this engine (`sprite_gen.gen`, providers `codex` and `grok` on a subscription you already pay for, plus an explicit-only `openai` provider for servers and SaaS that bills per call; the general `image-gen` skill is a thin shuttle over it). Video uses **your own** credential — the `grok` CLI login or an `XAI_API_KEY` — and nothing is shipped with the repo ([docs/video.md](docs/video.md)).`sprite-gen` supports CPython 3.10+; CI runs 3.10 and 3.14. The quickstart needs a Python with working `venv`/`ensurepip`.diff --git a/README.zh-Hans.md b/README.zh-Hans.mdindex ec34b69..693b1b5 100644--- a/README.zh-Hans.md+++ b/README.zh-Hans.md@@ -155,7 +155,7 @@ python3 ~/.codex/skills/.system/skill-installer/scripts/install-skill-from-githu--repo aldegad/sprite-gen --path . --name sprite-gen```-图像生成是本引擎的一部分(`sprite_gen.gen`,提供方 `codex` 与 `grok`;通用的 `image-gen` 技能只是覆在其上的一层薄封装)。视频使用**你自己的**凭据 —— `grok` CLI 登录或 `XAI_API_KEY` —— 仓库中不附带任何凭据([docs/video.md](docs/video.md))。+图像生成是本引擎的一部分(`sprite_gen.gen`,跑在你已经付费的订阅上的提供方 `codex` 与 `grok`,以及面向服务器与 SaaS、按调用计费、必须显式指定才会运行的 `openai` 提供方;通用的 `image-gen` 技能只是覆在其上的一层薄封装)。视频使用**你自己的**凭据 —— `grok` CLI 登录或 `XAI_API_KEY` —— 仓库中不附带任何凭据([docs/video.md](docs/video.md))。`sprite-gen` 支持 CPython 3.10+;CI 运行 3.10 与 3.14。快速开始需要一个 `venv`/`ensurepip` 可用的 Python。diff --git a/SKILL.md b/SKILL.mdindex e7615e8..2837097 100644--- a/SKILL.md+++ b/SKILL.md@@ -67,7 +67,8 @@ Pass choices already stated in the request. The guide checks access, combines ex| Standalone video / animate a still, pin a last frame, reference images | `video` (`--image`, `--last-frame`, `--reference`) | [video](docs/video.md) || Continue or edit an existing clip | `video-extend`, `video-edit` | [video](docs/video.md) || Grok video sprites | `video-set` | [video-pipeline](docs/video-pipeline.md) |-| Ordinary image or edit | `gen --provider codex` or `gen --provider grok` | [gen](docs/gen.md) |+| Ordinary image or edit | `gen --provider codex` or `gen --provider grok` (subscription routes) | [gen](docs/gen.md) |+| Image generation with no login available (server, container, SaaS) | `gen --provider openai` — server/SaaS route on `OPENAI_API_KEY`, **billed per call**, never a default or a fallback | [gen](docs/gen.md#subscription-first--openai-is-named-or-it-does-not-run) || Base and direction anchors | `anchor` | [directional-anchor-workflow](docs/directional-anchor-workflow.md) || Curation view or existing image candidates | `curation`, `unpack-atlas --pngs-dir` | [curation](docs/curation.md) || Uniform background removal or imported sheets | `cutout`, `slice-sheet` | [sheet-slicing](docs/sheet-slicing.md) |diff --git a/docs/architecture.md b/docs/architecture.mdindex c6b44ce..7c6770d 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -35,7 +35,7 @@ flowchart TBsubgraph pkg["sprite_gen/ (_modules.py owns the mapping)"]direction LRspec["spec<br/>read-only asset adapters · sprite-request schema · layout resolver · runio · migrations"]- gen["gen<br/>prepare · gen (codex / grok) · gen-set · video (Grok Imagine)"]+ gen["gen<br/>prepare · gen (codex / grok / openai) · gen-set · video (Grok Imagine)"]video["video<br/>canvas · frames · loop · batch (video-set)"]frames["frames<br/>extract · cutout · slice-sheet · unpack-atlas · segment"]curate["curate<br/>curation sidecar · direction anchors"]diff --git a/docs/gen.md b/docs/gen.mdindex 1309dba..2b4f068 100644--- a/docs/gen.md+++ b/docs/gen.md@@ -1,6 +1,6 @@# `sprite-gen gen` — provider-backed image generation (engine SSoT)-> Owns: `sprite-gen gen` / `gen-set`: providers, default resolution, transparency strategy per provider, row usage · Index: [docs/README.md](README.md)+> Owns: `sprite-gen gen` / `gen-set`: providers, default resolution, transparency strategy per provider, the billed knobs (`--quality`, `--resolution`), row usage · Index: [docs/README.md](README.md)Generation is a first-class engine module (`sprite_gen/gen/`), not an externalskill. One call = a prompt (+ optional reference images) → one **verified** PNG on@@ -16,22 +16,45 @@ whose terms forbid reaching a subscription login from third-party software is noadded, however it is invoked([#36](https://github.com/aldegad/sprite-gen/pull/36), Antigravity).-| Provider | Backend | Auth | Output truth | Transparency strategy |-|---|---|---|---|---|-| `codex` | codex `image_gen` | ChatGPT OAuth | inline base64 in the session rollout jsonl, decoded deterministically | **`native`** — image_gen returns a real alpha channel when asked (measured, then published) |-| `grok` | direct Imagine `/images/generations` or `/images/edits` | Grok login or `XAI_API_KEY` | inline bytes decoded and re-encoded as a verified PNG | `chroma` — Imagine returns JPEG only; generate on a key and matte it out |+| Provider | Backend | Auth | Billing | Output truth | Transparency strategy |+|---|---|---|---|---|---|+| `codex` | codex `image_gen` | ChatGPT OAuth | your ChatGPT subscription | inline base64 in the session rollout jsonl, decoded deterministically | **`native`** — image_gen returns a real alpha channel when asked (measured, then published) |+| `grok` | direct Imagine `/images/generations` or `/images/edits` | Grok login (preferred) or `XAI_API_KEY` | your SuperGrok Imagine quota; console credit only on the key route | inline bytes decoded and re-encoded as a verified PNG | `chroma` — Imagine returns JPEG only; generate on a key and matte it out |+| `openai` | direct Images `/v1/images/generations` or `/v1/images/edits` | `OPENAI_API_KEY` | **billed per call** — for servers and SaaS | inline base64 decoded and published as a verified PNG | **`native`** — `background: transparent` returns a real alpha channel |The strategy is declared **once**, on the adapter (`Provider.transparency`), and isthe only place that says what a backend can do. See[Transparent output](#transparent-output--strategy-per-provider).+## Subscription first — `openai` is named or it does not run++`codex` and `grok` run on a subscription the user already pays for. `openai`+reaches the same family of GPT image models over the REST API with nothing but a+key — which is what a headless container (a Modal worker, CI, a SaaS backend) can+have, and where an interactive ChatGPT login cannot exist — and every call is+billed against that key. So it is registered, documented, and **explicit-only**+(maintainer 확정 2026-09-20):++- it runs only when `--provider openai` names it;+- `SPRITE_GEN_DEFAULT_PROVIDER=openai` is **refused**, not honoured;+- the guided flow (`sprite-gen workflow`) never offers it and never saves it as a+ preference;+- no availability fallback targets it — a codex outage reaches `grok`, another+ subscription route, or it fails; it never reaches metered credit;+- having `OPENAI_API_KEY` in the environment changes no route by itself;+- every call it does make prints one stderr line naming the charge *before* the+ request leaves.++If you are one person generating sprites, use `codex` or `grok`.+## Default provider selection`--provider` is **optional**. When omitted, the backend is resolved by a fixedprecedence (maintainer 확정 2026-07-17):1. **`SPRITE_GEN_DEFAULT_PROVIDER`** env var (`codex` or `grok`) — the user override.- An unknown value fails loud.+ An unknown value fails loud, and so does `openai`: a per-call API backend is+ named at the call site or not used ([subscription first](#subscription-first--openai-is-named-or-it-does-not-run)).2. **`codex`** — the hard default (GPT `image_gen`).If the resolved default is `codex` but codex is unavailable here (CLI not on PATH,@@ -39,7 +62,8 @@ or `codex login status` reports not-logged-in), the resolution **falls back to`grok` — observably, never silently**: a stderr notice is printed and the reportJSON records `provider_fallback` (`from`/`to`/`reason`/`default_source`). Thegrok default (`SPRITE_GEN_DEFAULT_PROVIDER=grok`) has no reverse fallback — a down-grok fails loud at generation time.+grok fails loud at generation time. The fallback target is a subscription route by+construction; `openai` is never one.An **explicit `--provider`** is always honored verbatim — it is never overridden bythe availability fallback. An explicitly named provider that is down fails loud@@ -82,17 +106,68 @@ API contracts: [image generation](https://docs.x.ai/developers/model-capabilitie[image editing](https://docs.x.ai/developers/model-capabilities/images/editing),[multi-image editing](https://docs.x.ai/developers/model-capabilities/images/multi-image-editing).+## Direct OpenAI calls and authentication++`sprite-gen gen --provider openai` → `OpenAIProvider` → the OpenAI Images REST API.+No `codex` CLI, no browser sign-in, no subprocess: the whole credential is+`OPENAI_API_KEY`, read from the environment at call time and never written+anywhere. Unset, the run stops naming the variable and where to get a key; set but+empty, it says so. It never falls back to the codex ChatGPT login, to another key,+or to a retry — and see [subscription first](#subscription-first--openai-is-named-or-it-does-not-run)+for why nothing routes here on its own.++The default model is `gpt-image-2.5-flare`; `--model` selects another gpt-image+model. New images use `POST /v1/images/generations` (JSON); attaching `--ref` uses+`POST /v1/images/edits`, which takes **multipart/form-data** with the references as+repeated `image[]` parts in the order given (up to 16). A reference that is not a+readable PNG, JPEG or WebP fails before upload, and parts are named by position, not+by the local filename.++gpt-image models always answer with inline base64 (the API does not accept+`response_format`), so there is no signed URL to follow and no bearer token to+forward. The payload is decoded, verified as a PNG and published atomically without+resizing; a missing, malformed or multi-image response fails without replacing an+existing raw output. HTTP 401/403 names the credential; any other non-200 fails+with the status only — an error body can echo the prompt or a key, so it is not+printed.++`--aspect-ratio` picks the `size`. gpt-image has no long-edge preset, so the ratio+maps to one concrete size out of a table that satisfies the documented constraints+(both sides divisible by 16, ratio within 1:3..3:1, 655,360–8,294,400 pixels) and is+checked by the test suite: `1:1` 1024x1024, `3:2` 1536x1024, `2:3` 1024x1536, `4:3`+1024x768, `3:4` 768x1024, `16:9` 1536x864, `9:16` 864x1536, `2:1` 1440x720, `1:2`+720x1440, `3:1` 1536x512, `1:3` 512x1536, plus `auto`. Omitted = 1024x1024. A ratio+with no exact gpt-image size (`19.5:9`, say) is refused rather than rounded to a+nearby one you would be billed for.++`--transparent` asks for `background: transparent` with `output_format: png` —+genuine alpha, the same `native` strategy as codex, and the same measurement gate+afterwards. Measured 2026-09-20 on `gpt-image-2.5-flare` at `--quality low`: 84 % of+the frame at alpha 0, the subject itself at alpha 251–254 (so `partial_alpha_pct`+covers the body, exactly as codex `image_gen` does — downstream extraction treats+`alpha ≤ 16` as transparent, so this is usable as-is).++Image reports include `extra.auth_source`, `extra.transport: "openai-api"`,+`extra.endpoint`, `extra.quality`, `extra.size`, `extra.background` and, when the+API returns it, `extra.usage` (token counts only — what the call cost, never what it+contained).++API contract: [OpenAI Images](https://developers.openai.com/api/images/) (field names+and enums confirmed there 2026-09-20).+## CLI```bashsprite-gen gen \- [--provider codex|grok] # optional; default = SPRITE_GEN_DEFAULT_PROVIDER env → codex (observable grok fallback if codex is down)+ [--provider codex|grok|openai] # optional; default = SPRITE_GEN_DEFAULT_PROVIDER env → codex (observable grok fallback if codex is down). openai only when named here — it bills per call--prompt "…" # or --prompt-file PROMPT.txt--out DEST.png \- [--ref REF.png ...] # repeatable; Grok accepts up to five references+ [--ref REF.png ...] # repeatable; Grok accepts up to five references, openai up to sixteen[--transparent [--alpha-mode auto|native|chroma] [--chroma-key magenta|green]] \[--white-check CHECK.png] \- [--aspect-ratio 1:1] # grok only, e.g. 1:1 or 16:9; single-ref edits inherit the source ratio+ [--aspect-ratio 1:1] # grok and openai, e.g. 1:1 or 16:9; grok single-ref edits inherit the source ratio; openai maps it to a gpt-image size+ [--quality low|medium|high|xhigh|max|auto] # billed effort; openai takes the range, grok takes auto/low/medium+ [--resolution 1k|1.5k|2k] # grok output-size tier, priced with --quality[--model ID] \[--report REPORT.json] \[--keep-session] # codex: keep the rollout jsonl instead of deleting it@@ -110,7 +185,40 @@ Backward-compatible wrapper: `$SPRITE_GEN_ROOT/.venv/bin/python $SPRITE_GEN_ROOT`raw_bytes`, `elapsed_seconds`, `session_id` (codex), an `alpha` block(`strategy` + the measured stats), the `chroma` stats when chroma keying ran, and theprovider-resolution fields (`provider_resolved_from`, and `provider_fallback` when a- codex→grok default fallback occurred).+ codex→grok default fallback occurred), plus the provider `extra` block+ (`auth_source`, `transport`, `endpoint`, and the knobs the request actually+ carried).++## `--quality` and `--resolution` — the two billed knobs++They are one shared vocabulary; what a backend can honour is a per-provider+capability, declared in its adapter:++| Provider | `--quality` | `--resolution` |+|---|---|---|+| `codex` | refused — `image_gen` exposes no effort dial | refused |+| `grok` | `auto` `low` `medium` | `1k` `1.5k` `2k` |+| `openai` | `auto` `low` `medium` `high` `xhigh` `max` | refused — a gpt-image `size` comes from `--aspect-ratio` |++- **Omitted = the provider's own default.** The request body is then byte-identical+ to what the same call already sent, so nothing about existing runs changes.+- **A level a provider cannot honour fails before the call.** It is never dropped+ from a body you are about to pay for, and never downgraded to whatever the+ backend felt like returning (No Silent Fallback). "Refused" above is a loud error+ naming the flag, not a silently ignored argument.+- **grok prices an image on the pair**, so `2k` + `medium` costs more than `1k` ++ `low`. The resolution names are **tiers, not pixel counts**: the service decides+ the pixels, and `1.5k` came back 1408x1408 at `--aspect-ratio 1:1` (실측+ 2026-09-20) — not 1536, and not 1024. Nothing here derives a size from the name.+- The grok subsets were read off the server, not off the prose (2026-09-20 probes):+ `quality` deserializes the wider shared enum and *then* refuses per model+ (`high` → HTTP 400 "This model only supports the following quality value(s):+ low, medium, auto."), `resolution: 1.5k` renders (HTTP 200) although the+ capability guide's prose lists only 1k and 2k, and an **unknown field is not+ refused at all** — a probe carrying one rendered normally. That last one is why+ these names are checked locally instead of being left to the service to notice.+- Every call that spends API credit rather than a subscription prints the knobs it+ is being billed on in the same stderr line as the charge.## Transparent output — strategy per provider@@ -119,15 +227,17 @@ strategy it can execute, and `--alpha-mode auto` (the default) follows it:| Strategy | Who | What happens | Refused when ||---|---|---|---|-| `native` | `codex` (**first choice**, 2026-09-08) | The transport prompt asks image_gen for a genuinely transparent background (the bundled `imagegen` skill honours "transparent background" and keeps the generated alpha; codex reports `transparentBackground: true` on the completed item). The decoded PNG's alpha is **measured**: no alpha band or `alpha_zero_pct: 0.0` refuses to publish, RGB under alpha 0 is scrubbed, partial alpha (1–254) is left as produced and reported as `partial_alpha_pct`. | The model drew a checkerboard / flat background (RGB image) — nothing can recover alpha from that, so the run fails instead of silently keying. |+| `native` | `codex` (**first choice**, 2026-09-08), `openai` (`background: transparent`) | On codex the transport prompt asks image_gen for a genuinely transparent background (the bundled `imagegen` skill honours "transparent background" and keeps the generated alpha; codex reports `transparentBackground: true` on the completed item); on openai the request carries `background: transparent` with `output_format: png`, which the API answers with a real alpha channel. Either way the decoded PNG's alpha is **measured**: no alpha band or `alpha_zero_pct: 0.0` refuses to publish, RGB under alpha 0 is scrubbed, partial alpha (1–254) is left as produced and reported as `partial_alpha_pct`. | The model drew a checkerboard / flat background (RGB image) — nothing can recover alpha from that, so the run fails instead of silently keying. || `chroma` | `grok` (only option), `codex` with `--alpha-mode chroma` | Generate on a `#FF00FF` (or `#00FF00`) background — pick the key by subject colour (magenta subjects → green key) — and matte it out through the frame extractor's canonical YCbCr matte (`remove_chroma_background_ycbcr`), which keys from the background chroma it detects on the borders (`detect_background_key_ycc`) rather than from the pure key alone — the RGB matte behind `cutout`/`extract`/`slice-sheet` does the same since 2026-09-11 (`detect_background_key_rgb`), so every chroma path tolerates the slightly-off green/magenta generators actually paint. Gradients and texture within that chroma family are supported. | `alpha_zero_pct: 0.0` after keying, or stale RGB under alpha 0. |-- **`auto` steps down to `chroma` when `--ref` is attached**, even on codex. Measured+- **`auto` steps down to `chroma` when `--ref` is attached**, on either native provider. Measured2026-09-08 (plan `sprite-gen/parts-rig`): codex `image_gen` with reference imagesreturned real alpha in 1/6 runs and drew a checkerboard (RGB) in 5/6, while the sameprompts on a `#00FF00` key + chroma keying succeeded 6/6. The decision is made beforethe model runs, printed to stderr, and recorded as `alpha.strategy_source:- "refs-attached"` (`provider-default` / `explicit` otherwise). `--alpha-mode native`+ "refs-attached"` (`provider-default` / `explicit` otherwise). The measurement is+ codex's; openai's edit path is not separately measured and inherits the same+ conservative default. `--alpha-mode native`still forces native alpha with refs — and fails loud on an RGB result. So a ref run'sprompt must carry the chroma key, exactly as the sprite-row pipeline already does.- `--alpha-mode chroma` on codex is for prompts that already carry a key background@@ -176,6 +286,10 @@ change it; and no `config.toml` feature toggle grants it. The remedy is to point(`codex login status`), or to use `--provider grok`. The adapter fails loudly withexactly that, rather than falling back on its own.- **grok** — uses the [direct API contract](#direct-grok-calls-and-authentication) above.+- **openai** — uses the [direct API contract](#direct-openai-calls-and-authentication)+ above: one HTTPS request on `OPENAI_API_KEY`, no CLI and no subprocess, which is+ the whole reason it exists (a container has a key, not a browser). Explicit-only,+ and billed per call.## Sprite-row usagediff --git a/docs/video.md b/docs/video.mdindex acc7673..007911c 100644--- a/docs/video.md+++ b/docs/video.md@@ -66,7 +66,9 @@ Resolution order is fixed for both images and videos: **the Grok subscriptionlogin wins**, even when `XAI_API_KEY` is set. `GROK_HOME` relocates `~/.grok`.Only when no login file exists can the configured API key use console credits.An expired, unreadable, corrupt or API-rejected login stops the request; it never-switches to API credit. An empty API key is ignored when the login is usable,+switches to API credit. A clip that does leave on `XAI_API_KEY` says so on stderr+before it uploads — one line per submitted job, naming the duration and resolution+it is billed on; the subscription route stays silent. An empty API key is ignored when the login is usable,but is an error when no login exists. With neither credential, the run stopswith both setup paths spelled out.