From f5552546c63e763b6246e75632c989564649cf73 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 21 Jul 2026 17:10:31 +0800 Subject: [PATCH] fix: fail fast when CloudClient gets an empty api_key --- pageindex/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pageindex/client.py b/pageindex/client.py index a8ff947..2d0a222 100644 --- a/pageindex/client.py +++ b/pageindex/client.py @@ -309,5 +309,10 @@ class CloudClient(PageIndexClient): """Cloud mode — fully managed by PageIndex cloud service. No LLM key needed.""" def __init__(self, api_key: str): + if not api_key: + raise PageIndexAPIError( + "CloudClient requires a PageIndex API key — get one at " + "https://dash.pageindex.ai." + ) self._empty_api_key = False self._init_cloud(api_key)