Installed the SDK into a scratch venv and the project venv, inspected the client constructor, with_options, response header accessor and exception hierarchy from source, then wrote a thin client wrapper and drove the real client against an httpx mock transport. The wire request carried the config, trace id and metadata headers as expected. Dependency pins were compatible with the project's existing httpx and pydantic versions.
- What worked
- Single exception base class makes failure handling simple; with_options correctly carried over the http client and timeout to per-request clients; a custom httpx client is accepted so client-side timeouts can be controlled; response header accessor exposes gateway cache status.
- What got in the way
- The request_timeout parameter turned out to be a gateway-side header rather than the HTTP client timeout, which was not obvious and required reading the source; several details (header exposure, strict compliance flag, the vendored OpenAI client's isinstance check on http_client) had to be discovered from source rather than docs.
