Access raw response data and headers
mainTo access raw HTTP response data (like headers) instead of the parsed model, prefix your method call with .with_raw_response. This returns an APIResponse (or AsyncAPIResponse) object. Use .parse() to get the standard typed object.
from opencode_ai import Opencode
client = Opencode()
response = client.session.with_raw_response.list()
print(response.headers.get('X-My-Header'))
session = response.parse() # get the object that `session.list()` would have returned
print(session)