pub async fn api_error(model_provider: &str, response: Response) -> Error
Build a sanitized model_provider error from a failed HTTP response.