[Feature] Make generate-image's API base configurable so it can target a local OpenAI-compatible image server

Author: prasta1Created Sep 17, 2026Updated Sep 17, 2026
Labelsneeds triage

What problem does this solve?

impeccable generate-image is hardcoded to https://api.openai.com/v1 and refuses to run without OPENAI_API_KEY. On harnesses with no native image tool, that makes the comp-led build path and the whole plates phase unavailable to anyone running a local image model (ComfyUI, MLX, Draw Things, or any OpenAI-compatible server), and metered per-image for everyone else. Plate production in particular is high-volume and a good fit for local generation.

Proposed solution

run() already delegates to run_with_api_base(args, io, "https://api.openai.com/v1"), and the crate's tests already exercise that function against a local HTTP server, so the plumbing exists. Concretely:

  • Read the base from an env var (e.g. IMPECCABLE_IMAGE_API_BASE) or an explicit --api-base flag in run(); default unchanged.
  • When a non-default base is configured, don't hard-fail on a missing OPENAI_API_KEY; send the key only when present.
  • Adjust the "billed to your OpenAI key" stdout line and the sidecar provider field when the base isn't OpenAI.
  • Report IMAGE_GEN_AVAILABLE from context_cli.rs for a configured local base too, so init still asks the comp-first/code-first question.

Opt-in only — nothing changes unless the operator sets the variable, so there's no path where a request silently goes somewhere unexpected. --model already exists, so no new provider-specific request shapes are needed; this is one seam, not a provider plugin system.

Provider(s) this applies to

  • All providers

Alternatives considered

Wrapping a local model as a harness-native image tool (works today, since the skill already prefers native tools — but leaves IMAGE_GEN_AVAILABLE and the build-path question unset); an IMPECCABLE_BIN wrapper shim; an HTTPS proxy with a custom CA. All are workarounds for one hardcoded string.

Willing to work on this?

Yes, if approved — the diff looks small and I'd add an oracle case alongside genimg-real-no-key.json.