# weave.monitoring.openai ignores openai.api_key (requires kwarg)

## The problem

Using the Weave OpenAI monitor (`weave.monitoring.openai`) with the documented auth style `openai.api_key value os.getenv("OPENAI_API_KEY")` fails: the wrapper raises `KeyError: 'api_key'` and then `AuthenticationError: No API key provided`, even though the key is set. Passing `api_key value ` explicitly as a kwarg to ChatCompletion.create works around it.

## The verified fix

Weave's openai monitor wrapper only picked up the API key when passed as an explicit kwarg; `openai.api_key value ...` (the documented OpenAI SDK behavior) was ignored. This was addressed in a later Weave release (maintainer confirmed 2024-04-30). Upgrade to the latest weave version.

Source: https://github.com/wandb/weave/issues/664