#15991: feat: add Novita AI provider support with dynamic model discovery
docs
cli
commands
agents
stale
size: L
Cluster:
Provider Support Enhancements
## Summary
- Add Novita AI as a first-class provider (`novita`) with OpenAI-compatible API endpoint (`https://api.novita.ai/openai`)
- Implement dynamic model discovery from Novita's `/v1/models` endpoint with in-process caching and static fallback catalog
- Full onboarding integration: interactive wizard, non-interactive CLI flags (`--novita-api-key`), auth profile management, and environment variable support (`NOVITA_API_KEY`)
## Changes
- **Core provider**: `novita-models.ts` — model discovery, caching, static fallback catalog
- **Auth & onboarding**: credential storage (`novita:default` profile), onboarding config, preferred-provider mapping
- **CLI**: `--auth-choice novita-api-key` and `--novita-api-key` flags
- **Docs**: provider guide at `docs/providers/novita.md` with quick start, non-interactive example, and popular models
- **Tests**: unit tests for model discovery and provider config, e2e smoke tests for onboarding
## Test plan
- [ ] Run `openclaw onboard --auth-choice novita-api-key` with a valid API key
- [ ] Verify `openclaw models list --all` shows `novita/*` models
- [ ] Run non-interactive onboarding: `openclaw onboard --non-interactive --mode local --auth-choice novita-api-key --novita-api-key $NOVITA_API_KEY`
- [ ] Verify unit tests pass: `novita-models.test.ts`, `models-config.providers.novita.test.ts`
Co-authored-by: Joseph Pollack <joseph@legml.ai>
Supersedes #13300
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds Novita AI as a first-class provider (`novita`) with OpenAI-compatible API endpoint, dynamic model discovery with in-memory caching, and full onboarding integration (interactive wizard, CLI flags, auth profiles, env var support).
- **Core provider** (`novita-models.ts`): Implements dynamic model discovery from `/v1/models` with 5-minute in-memory cache, static fallback catalog (Kimi K2.5), and metadata inference (reasoning, vision support). Follows the Hugging Face/Venice discovery pattern.
- **Auth & config**: Adds `NOVITA_API_KEY` env var support, `novita:default` auth profile, `--novita-api-key` CLI flag, and `--auth-choice novita-api-key`. All onboarding paths (interactive + non-interactive) are wired.
- **Key resolution** in `models-config.providers.ts`: Uses a dual-resolution approach — `resolveEnvApiKeyVarName` for config storage and a new `resolveEnvApiKeyValue` helper for the actual key value needed by discovery. This is more complex than other providers (e.g., Together uses a simpler pattern, HuggingFace resolves inside the build function) but works correctly.
- **Tests**: Unit tests cover discovery, caching, and fallback. E2E tests verify non-interactive onboarding and CLI smoke tests.
- **Docs**: Provider guide at `docs/providers/novita.md` with quick start, non-interactive example, and model examples. Added to provider index and concepts pages.
- Minor style note: the `inferImageSupport` function's `"vl"` substring check is overly broad and could false-positive on unrelated model names. Also, `NOVITA_DEFAULT_MODEL_REF` is exported from both `novita-models.ts` and `onboard-auth.credentials.ts` (only the latter is imported by consumers).
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge — it follows established provider patterns closely and the integration is well-tested.
- The implementation closely mirrors existing providers (Together, Hugging Face, Venice) across all integration points: auth, onboarding, CLI flags, config, and model discovery. The code is well-structured with proper error handling and fallback paths. Two minor style concerns (overly broad "vl" substring match in vision inference, duplicate constant export) don't affect correctness. Tests cover the main scenarios. The dual key resolution approach in resolveImplicitProviders is slightly more complex than necessary but logically correct.
- `src/agents/novita-models.ts` — the `inferImageSupport` function's `"vl"` substring match could produce false positives for model names containing "vl" in unrelated contexts (e.g., "evolve", "evaluation").
<sub>Last reviewed commit: e31c175</sub>
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#7418: feat (amazon-nova): add Amazon Nova 1P provider
by 5herlocked · 2026-02-02
83.5%
#1943: Add jan.ai provider documentation
by csa1234 · 2026-01-25
81.0%
#10424: feat: Add OVHcloud AI Endpoints as a provider
by eliasto · 2026-02-06
80.0%
#8232: Nebius token factory Provider support
by KiranChilledOut · 2026-02-03
79.2%
#8216: Feat: Add sambanova provider
by luisfucros · 2026-02-03
79.2%
#7113: feat(providers): add CommonStack provider support
by flhoildy · 2026-02-02
78.7%
#13295: feat: add Eternal AI provider integration
by peterparkernho · 2026-02-10
78.4%
#20965: feat: Add comprehensive model configuration and discovery for various…
by rodeok · 2026-02-19
78.4%
#8783: feat(provider/volcengine): support volcengine provider
by ShanyouYu-Sean · 2026-02-04
78.3%
#12059: feat(agents): Add Azure AI Foundry credential support
by lisanyambere · 2026-02-08
78.2%