Can we get a feature to specify project keys. At the moment we're forced to use one OpenAI key
As mentioned in the title, the ServiceProvider forced one orginization key but also only one API key. A newer version of the API now supports project keys which can have their own api keys as well. It would be nice to have the functionality to specify different keys on demand
I got confused at this, but now re-reading this. You are requesting pluggable API keys and I think thats a good idea. I just need to brainstorm on how.
Since the client is HTTP agnostic and the client is assembled once established - there is not like a generic method we can rely on (outside of headers) to do this. I'll think on this.
I think I've been dealing with a similar problem. In my application code I was able to do something like this:
OpenAI::factory()->withApiKey($apiKey)->make()
The problem with this for me was mostly in tests which were using OpenAI::fake(), since the fake instance that's provided doesn't have methods like "factory" so calling factory on your application would break those tests.
Is this somewhat similar to your problem(s)?