@@ -225,10 +225,12 @@ async def _ensure_zones(self) -> None:
225225 if self ._zone_manager is None :
226226 self ._zone_manager = ZoneManager (self .engine )
227227
228+ # Don't pass browser_zone to auto-creation because browser zones
229+ # require additional configuration and cannot be auto-created
228230 await self ._zone_manager .ensure_required_zones (
229231 web_unlocker_zone = self .web_unlocker_zone ,
230232 serp_zone = self .serp_zone ,
231- browser_zone = self . browser_zone
233+ browser_zone = None # Never auto-create browser zones
232234 )
233235 self ._zones_ensured = True
234236
@@ -341,17 +343,23 @@ async def test_connection(self) -> bool:
341343 self ._is_connected = False
342344 return False
343345
344- async def get_account_info (self ) -> AccountInfo :
346+ async def get_account_info (self , refresh : bool = False ) -> AccountInfo :
345347 """
346348 Get account information including usage, limits, and quotas.
347349
350+ Note: This method caches the result by default. For fresh zone data,
351+ use list_zones() instead, or pass refresh=True.
352+
348353 Retrieves:
349354 - Account status
350355 - Active zones
351356 - Usage statistics
352357 - Credit balance
353358 - Rate limits
354359
360+ Args:
361+ refresh: If True, bypass cache and fetch fresh data (default: False)
362+
355363 Returns:
356364 Dictionary with account information
357365
@@ -360,11 +368,18 @@ async def get_account_info(self) -> AccountInfo:
360368 APIError: If API request fails
361369
362370 Example:
371+ >>> # Cached version (fast)
363372 >>> info = await client.get_account_info()
364373 >>> print(f"Active zones: {len(info['zones'])}")
365- >>> print(f"Credit balance: ${info['balance']}")
374+
375+ >>> # Fresh data (use this after creating/deleting zones)
376+ >>> info = await client.get_account_info(refresh=True)
377+ >>> print(f"Active zones: {len(info['zones'])}")
378+
379+ >>> # Or better: use list_zones() for current zone list
380+ >>> zones = await client.list_zones()
366381 """
367- if self ._account_info is not None :
382+ if self ._account_info is not None and not refresh :
368383 return self ._account_info
369384
370385 try :
@@ -447,9 +462,14 @@ def _run_async_with_cleanup(self, coro):
447462 finally :
448463 loop .close ()
449464
450- def get_account_info_sync (self ) -> AccountInfo :
451- """Synchronous version of get_account_info()."""
452- return self ._run_async_with_cleanup (self .get_account_info ())
465+ def get_account_info_sync (self , refresh : bool = False ) -> AccountInfo :
466+ """
467+ Synchronous version of get_account_info().
468+
469+ Args:
470+ refresh: If True, bypass cache and fetch fresh data (default: False)
471+ """
472+ return self ._run_async_with_cleanup (self .get_account_info (refresh = refresh ))
453473
454474 def test_connection_sync (self ) -> bool :
455475 """Synchronous version of test_connection()."""
0 commit comments