Client
PoliPage(*, api_key: str | None = None, base_url: str | None = None, timeout: float = 60.0, max_retries: int = 2, retry_delay: float = 0.5, on_retry=None, on_error=None, http_client=None) Synchronous Poli Page client.
Constructor
Section titled “Constructor”Every parameter is keyword-only and optional. api_key falls back to POLI_PAGE_API_KEY from the environment. See Configuration for the full list of options and defaults, and PoliPageOptions for every field.
Sync vs async
Section titled “Sync vs async”The SDK ships two parallel client classes:
PoliPage— synchronous, backed byhttpx.Client. Use as a context manager (with PoliPage(...) as client:) or call.close()to release sockets.AsyncPoliPage—asyncio-native, backed byhttpx.AsyncClient. Useasync with AsyncPoliPage(...) as client:or callawait client.aclose().
The two surfaces are byte-equivalent except for async/await.
Namespaces
Section titled “Namespaces”The client exposes two namespaces:
render— render PDFs (in memory, streaming, or to a stored document).documents— fetch, preview, thumbnail, or delete stored documents.
The standalone helpers render_to_file and async_render_to_file live in poli_page.fs.