HKUDS/nanobot · error · ValueError

Provider ' ' requires api_base in config.

Error message

Provider '{provider_name}' requires api_base in config.

What it means

Validation in _resolve_provider_setup: the backend is openai_compat with a direct (non-dynamic) spec that has no default_api_base, and no api_base override exists in the provider config. A direct OpenAI-compatible provider without a built-in endpoint URL cannot know where to send requests, so the factory rejects the setup.

Solutions

  1. Add api_base to providers.<name> in config pointing at the OpenAI-compatible endpoint
  2. Use a provider spec that ships a default_api_base
  3. If targeting a known provider, use its canonical name instead of a generic direct openai_compat entry
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nanobot/providers/factory.py:116 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/6071acc3c1bd1131. Report an issue: GitHub.

Appendix: source

Thrown at nanobot/providers/factory.py:116

        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,
        provider_name=provider_name,
        provider_config=p,
        spec=spec,
        backend=backend,
    )


def validate_provider_setup(

View on GitHub (pinned to 42f37dc4c0)