zeroclaw-labs/zeroclaw · warning · anyhow::Error

live model listing is not supported for this model_provider

Error message

live model listing is not supported for this model_provider

What it means

list_models on an OpenAI-compatible provider can enumerate models only when it has at least one source: a resolved credential (native /models), public_model_listing, a models_dev key, or an openrouter_vendor_prefix. With none of these configured there is no way to list models live, so it bails rather than return an empty list that would look like 'no models exist'.

Source

Thrown at crates/zeroclaw-providers/src/compatible.rs:2714

            })?;
            return Ok(normalize_model_ids(body));
        }
        // No credential — try models.dev first, then OpenRouter as a
        // last-resort fallback for vendors that aren't in models.dev.
        if let Some(key) = &self.models_dev_key {
            match crate::models_dev::list_models_for(key).await {
                Ok(models) if !models.is_empty() => return Ok(models),
                Ok(_) => {} // empty → fall through to openrouter
                Err(e) => {
                    if self.openrouter_vendor_prefix.is_none() {
                        return Err(e);
                    }
                }
            }
        }
        match &self.openrouter_vendor_prefix {
            Some(prefix) => crate::openrouter_catalog::list_models_for_vendor(prefix).await,
            None => anyhow::bail!("live model listing is not supported for this model_provider"),
        }
    }

    async fn list_models_with_pricing(
        &self,
    ) -> anyhow::Result<Vec<zeroclaw_api::model_provider::ModelInfo>> {
        // When a credential is present, hit the provider's native /models
        // endpoint — this returns pricing data that we can capture.
        let list_credential = self.resolve_credential().await?;
        if list_credential.is_some() || self.public_model_listing {
            let url = format!("{}/models", self.base_url);
            let response = self
                .apply_auth_header(self.http_client().get(&url), list_credential.as_deref())
                .send()
                .await
                .map_err(|e| {
                    ::zeroclaw_log::record!(
                        ERROR,

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Set an api_key on the alias so the native {base_url}/models endpoint is used
  2. Set public_model_listing = true for local servers that expose /models without authentication
  3. Set models_dev_key (or openrouter_vendor_prefix for vendors listed on OpenRouter) so a public catalog is used
  4. Or configure the alias's static models list and skip live listing for it
Defensive patterns

Strategy: validation

Validate before calling

// Only call live listing when the alias can actually support it
let can_list = alias.api_key.is_some()
    || alias.public_model_listing
    || alias.models_dev_key.is_some()
    || alias.openrouter_vendor_prefix.is_some();
if !can_list {
    return Ok(alias.static_models.clone()); // skip live listing entirely
}

Try / catch

match provider.list_models().await {
    Ok(models) => Ok(models),
    Err(e) if e.to_string().contains("live model listing is not supported") => {
        Ok(alias.static_models.clone()) // known limitation: use configured list
    }
    Err(e) => Err(e),
}

Prevention

When it happens

Trigger: Calling list_models() on a compatible-family alias configured without api_key, without public_model_listing = true, without models_dev_key, and without openrouter_vendor_prefix - typically a bare custom alias meant for chat only.

Common situations: Local aliases with a hardcoded default model and no credential in config; UI model pickers that call list_models on every alias; setups where the key is supplied per-request instead of in configuration.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/ef7b32265f72560a. Report an issue: GitHub.