from box_sdk_gen import ProxyConfig

proxied_client = client.with_proxy(
    config=ProxyConfig(url="http://proxy.example:8080")
)

Use proxied_client for the API operations that need this route. client is the existing authenticated BoxClient; calling with_proxy and discarding its return value leaves later operations on the original object.

ProxyConfig accepts username and password for the intermediary when needed. Those are separate from the Box authentication object. An HTTP endpoint selected from the HTTP proxy list can supply a public route for ProxyConfig. The method derives a network session with that proxy configuration, retaining the application's appropriate authentication and retry policy.

This is the generated box_sdk_gen interface. An older boxsdk.Client recipe with Requests session customization or a proxies constructor argument targets another generation; check the imported class before adapting it.

Related articles