HKUDS/nanobot · error · ValueError
Azure OpenAI requires api_base in config.
Error message
Azure OpenAI requires api_base in config.
What it means
Validation in _resolve_provider_setup: the resolved backend is azure_openai, which has no default endpoint, yet no providers.azure.api_base (Azure resource endpoint URL) is configured. Azure OpenAI clients cannot construct a deployment URL without it, so setup is rejected before any client is built.
Solutions
- Set providers.azure.apiBase to your Azure OpenAI resource endpoint (https://<resource>.openai.azure.com)
- Verify the provider name in the config maps to the Azure entry that carries api_base
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nanobot/providers/factory.py:108 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/3ca8929d7b46dc76.
Report an issue: GitHub.
Appendix: source
Thrown at nanobot/providers/factory.py:108
if not p.api_base:
raise ValueError(f"Provider '{provider_name}' requires api_base in config.")
spec = create_dynamic_spec(
provider_name,
display_name=(p.display_name or "") if p else "",
thinking_style=(p.thinking_style or "") if p else "",
)
if spec and spec.is_transcription_only:
raise ValueError(f"Provider '{provider_name}' only supports transcription.")
backend = spec.backend if spec else "openai_compat"
if p and p.proxy and backend not in {"openai_compat", "openai_codex", "xai_grok"}:
raise ValueError(
f"providers.{provider_name}.proxy is only supported for "
"OpenAI-compatible providers, OpenAI Codex, and xAI Grok."
)
if backend == "azure_openai":
if not p or not p.api_base:
raise ValueError("Azure OpenAI requires api_base in config.")
elif (
backend == "openai_compat"
and spec
and spec.is_direct
and not spec.default_api_base
and not (p and p.api_base)
):
raise ValueError(f"Provider '{provider_name}' requires api_base in config.")
elif backend in {"anthropic", "openai_compat"} and not (
backend == "openai_compat" and model.startswith("bedrock/")
):
needs_key = not (p and p.api_key)
exempt = spec and (spec.is_oauth or spec.is_local or spec.is_direct)
if needs_key and not exempt:
raise ValueError(f"No API key configured for provider '{provider_name}'.")
return _ProviderSetup(
model=model,View on GitHub (pinned to 42f37dc4c0)