HKUDS/nanobot · error · ValueError
providers. .api_type is only supported for providers.openai
Error message
providers.<name>.api_type is only supported for providers.openai
What it means
In ProvidersConfig._validate_api_type_scope, api_type was set to something other than "auto" on a provider other than providers.openai (checked across all declared fields and custom extra providers). The explicit API surface override is only implemented for the OpenAI provider; the input at fault is the api_type on the named non-openai provider.
Solutions
- Move the provider settings under providers.openai if the api_type override is needed
- Reset api_type to "auto" (or remove it) for other providers
- Choose a built-in provider that natively matches the desired API surface
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nanobot/config/schema.py:327 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26).
Data as JSON: /api/errors/6c30cd6c3e152864.
Report an issue: GitHub.
Appendix: source
Thrown at nanobot/config/schema.py:327
for key, value in self.model_extra.items():
if spec := find_by_name(key):
raise ValueError(
f"providers.{key} conflicts with built-in provider {spec.name!r}; "
"use the built-in provider key or choose a different custom provider name"
)
if isinstance(value, dict):
self.model_extra[key] = ProviderConfig.model_validate(value)
return self
@model_validator(mode="after")
def _validate_api_type_scope(self) -> "ProvidersConfig":
for name in self.__class__.model_fields:
if name == "openai":
continue
provider = getattr(self, name, None)
if isinstance(provider, ProviderConfig) and provider.api_type != "auto":
raise ValueError("providers.<name>.api_type is only supported for providers.openai")
for provider in (self.model_extra or {}).values():
if isinstance(provider, ProviderConfig) and provider.api_type != "auto":
raise ValueError("providers.<name>.api_type is only supported for providers.openai")
return self
class HeartbeatConfig(Base):
"""Heartbeat service configuration (now backed by cron)."""
enabled: bool = True
interval_s: int = 30 * 60 # 30 minutes
keep_recent_messages: int = 8
class ApiConfig(Base):
"""OpenAI-compatible API server configuration."""
host: str = "127.0.0.1" # Safer default: local-only bind.View on GitHub (pinned to 42f37dc4c0)