I figured it out mostly from reading forum posts here. Would be lovely if you could add an example to the REST API documentation..
I've submitted 3 examples to Adafruit's adafruit_requests library examples for API integrations for OpenSky-Network.
Base64 Encoding the username:password string into the header is definitely required.
In this example "username:password" base64 encodes to IFVTRVJOQU1FOlBBU1NXT1JEIA==\n
Example API HEADER: {'Authorization': 'Basic IFVTRVJOQU1FOlBBU1NXT1JEIA==\\n'}
Example API GET URL: OpenSky base URL/api/states/all?icao24=7c6b2d
osnu = "username"
osnp = "password"
transponder = "7c6b2d"
base_url = "insert opensky base url here"
osn_cred = str(osnu) + ":" + str(osnp)
bytes_to_encode = b" " + str(osn_cred) + " "
base64_string = (bytes_to_encode)
basepw = repr(base64_string)[2:-1]
osn_header = {"Authorization": "Basic " + str(basepw)}
OPENSKY_SOURCE = " (base_url)" + "icao24=" + transponder
opensky_response = requests(url=OPENSKY_SOURCE, headers=osn_header).json()
dump_object = (opensky_response)
print("JSON Dump: ", dump_object)
osn_flight = opensky_response["time"]
print("Current Unix Time: ", osn_flight)
This is Adafruit Circuit Python code so likely won't be a direct translation for python users. You can probably infer a lot if you're a regular python user. Now have OpenSky working on an ESP32-S3 using a simple GET request.