The Problem
By default, the underlying httpx HTTP library used by this SDK applies a strict 5-second timeout to all network requests.
If an API method takes longer than 5 seconds to process-for example, generating a large PDF file, querying a heavy dataset, or doing operations over a slow network connection-the SDK will unexpectedly crash with a TimeoutException.
Currently, the only way for developers to fix this is to understand how httpx works underneath, build a custom httpx.Client() object with a custom timeout, and explicitly pass it into our SDK upon initialization. This is a bit too much boilerplate work for such a common requirement.
Proposed Solution
We should add a built-in timeout parameter directly into the initialization methods of all our clients (Client, AsyncClient, OauthClient, and AsyncOauthClient), giving it a safer default limit of 30.0 seconds.
Expected behavior:
# Before: Developers had to do all this
import httpx
custom_client = httpx.Client(timeout=60.0)
client = Client(token="abc", client=custom_client)
# After: Simple, clean SDK syntax
client = Client(token="abc", timeout=60.0)
Acceptance Criteria
Why this matters / Benefits
- Smarter Defaults: Bumping the default timeout from 5 to 30 seconds prevents the SDK from crashing during heavier, perfectly valid API workloads.
- Better Developer Experience (DX): Allows users to configure timeouts cleanly in one line of code without needing to learn the intricacies of the underlying
httpx library.
The Problem
By default, the underlying
httpxHTTP library used by this SDK applies a strict 5-second timeout to all network requests.If an API method takes longer than 5 seconds to process-for example, generating a large PDF file, querying a heavy dataset, or doing operations over a slow network connection-the SDK will unexpectedly crash with a
TimeoutException.Currently, the only way for developers to fix this is to understand how
httpxworks underneath, build a customhttpx.Client()object with a custom timeout, and explicitly pass it into our SDK upon initialization. This is a bit too much boilerplate work for such a common requirement.Proposed Solution
We should add a built-in
timeoutparameter directly into the initialization methods of all our clients (Client,AsyncClient,OauthClient, andAsyncOauthClient), giving it a safer default limit of30.0seconds.Expected behavior:
Acceptance Criteria
timeout: float = 30.0toClientandAsyncClient.timeout: float = 30.0toOauthClientandAsyncOauthClient.httpxclient natively.httpxclient, their settings are preserved and not overridden.README.mdand PyPI docs with code examples showing how to configure the timeout.Why this matters / Benefits
httpxlibrary.