Client.session is Tweepy 4.14's documented Requests session for v2 API traffic:

import tweepy

client = tweepy.Client(bearer_token=bearer_token)
client.session.proxies.update({
    'http': 'http://proxy.example:8080',
    'https': 'http://proxy.example:8080',
})

Make the v2 calls through this client after setting the map. An endpoint from the HTTP proxy list can supply a public HTTP route for these proxy values. The bearer token authenticates to the provider; any account in the proxy configuration authenticates the intermediary.

If an API(proxy=...) example fails with this constructor, check the class: that parameter belongs to Tweepy's v1.1 API. Configuring another standalone Requests session likewise does not alter client.session.

Requests environment integration remains enabled, so inherited proxy and bypass inputs can affect selection. Independently created authentication or streaming objects may use another connection; this setting covers the stated v2 session rather than those objects or the provider's API-access rules.

Erthyglow kevrennek