Add a first-class `kimi` provider and `kimi://` DSN scheme for Moonshot AI's OpenAI-compatible Chat Completions API. Both reuse provider/openai (no new client, mirroring llama-swap's chat path). Default endpoint is the international host; the China endpoint is reachable via a kimi:// LLM_* DSN. - Credential is KIMI_API_KEY, read through the registry's injected envLookup so it stays hermetically testable. WithAPIKey is passed unconditionally so an unset KIMI_API_KEY can never fall through to the openai client's OPENAI_API_KEY default. - New openai.WithAPIKeyName option customizes the missing-key error hint (default OPENAI_API_KEY); kimi names KIMI_API_KEY. - Hermetic tests: built-in base URL + bearer, missing-key hint names KIMI_API_KEY with no OPENAI fallthrough and no network hit, kimi:// scheme round-trips against the China host. - Docs in sync: README built-in table + DSN scheme list + support matrix, .env.example, env.go DSN doc, ADR-0026 (+ index, backfilling 0024/0025), progress.md. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Architecture Decision Records
One decision per file, append-only; supersede rather than rewrite.
| ADR | Title | Status |
|---|---|---|
| 0001 | Package layout — canonical types in leaf llm, root re-exports |
Accepted |
| 0002 | Canonical message/content model | Accepted |
| 0003 | Parse grammar — verbatim ids, inline alias expansion, chains | Accepted |
| 0004 | LLM_* env-DSN provider definitions (go-llm parity + eager load) | Accepted |
| 0005 | Provider interface and capabilities model | Accepted |
| 0006 | Model health tracking and backoff | Accepted |
| 0007 | Dependency policy — stdlib-first, hand-rolled REST clients | Accepted |
| 0008 | Failover-chain execution semantics | Accepted |
| 0009 | Multimodal strategy — normalize per target, enforce at provider | Accepted |
| 0010 | Tools and structured output — canonical shape, native mappings | Accepted |
| 0011 | Google provider on the official Gen AI SDK | Accepted |
| 0012 | Agent run loop | Accepted |
| 0013 | Skill model — additive instruction+tool bundles | Accepted |
| 0014 | Conversion-driven extensions (resolvers, typed tools, hooks, ops controls) | Accepted |
| 0015 | llama-swap provider — reuse openai for chat, tailored management + image | Accepted |
| 0016 | imagegen — a canonical text-to-image interface | Accepted |
| 0017 | audio — canonical speech synthesis + transcription interfaces | Accepted |
| 0018 | imagegen.Editor — image-to-image as a separate optional interface | Accepted |
| 0019 | videogen — canonical video-generation surface | Accepted |
| 0020 | Upstream-passthrough media surfaces (mask, upscale, background removal, interpolation, diarization, meshgen) | Accepted |
| 0021 | musicgen — blocking Generate over an async job queue | Accepted |
| 0022 | embeddings + rerank interface | Accepted |
| 0023 | Wave-3 image + document surfaces (segmentation, colorize, face restore, OCR) | Accepted |
| 0024 | Wave-3 audio surfaces (stems, SFX, speech enhance, voice clone, translate) | Accepted |
| 0025 | Wave-3 video surfaces (lipsync, video matte, video upscale, chain jobs) | Accepted |
| 0026 | Kimi (Moonshot AI) built-in provider — reuse openai client, KIMI_API_KEY | Accepted |