System data : Is there a way to opt-out?


while trying to debug API calls made to OpenAI APIs I discovered that the Python SDK is sending system info data to the server including :

  • OS
  • Arch
  • Python runtime
  • Python runtime version

For example :

headers: {
  x-stainless-os: "MacOS"
  accept-encoding: "gzip, deflate"
  x-stainless-arch: "arm64"
  x-stainless-lang: "python"
  x-stainless-async: false
  x-stainless-runtime: "CPython"
  x-stainless-package-version: "1.12.0"
  x-stainless-runtime-version: "3.11.7"

Is there an Opt-Out option to disable this behaviour ? Or maybe it is in the CGU of OpenAI APIs ?

Source code for reference

You can override these for privacy like so:

client = OpenAI(default_headers={
  'X-Stainless-Arch': 'private',
  'X-Stainless-OS': 'private',

There is not currently a way to remove all of these headers in one go; if you’d like to see that, please file an issue on the SDK’s github repo with more details about your use-case and which headers you’d like to see hidden.