Perhaps, you are going to build an AI application for the public with Val.Town.
Personally, you may want to use the Open AI access that comes with Val.Town, but for the entirety of your users the rate limits of that access will be too low.
Thus, you may want them to bring their own AI provider with their own server URL and access key.
But, wait, how do you than use your own application, still using Val.Town's Open AI access?
This is where this val comes in (assuming that you already have a Val.Town account, either a free or a paid one):
- fork this val
- use the fork's HTTP endpoint URL (in the form "https://XXX-openaichatcompletion.web.val.run") as AI server URL
- define an environment variable called "OpenAIChatCompletion" with any kind of content (but without any blanks or control characters, e.g., a UUID) and use that as your personal access key
Now, you can ask everybody to provide their AI credentials and still use the OpenAI access provided by Val.Town for your personal tests.
Nota bene: if the environment variable "OpenAIChatCompletion" has not been defined, access to your fork's endpoint is free for everybody!
In addition to the described authorization, this val also provides resource "throttling" (using val floatingQuotaTracker in sqlite tables "OpenAIChatCompletion_Info" and "OpenAIChatCompletion_Log") and calculates some access statistics (using val InvocationTracker in sqlite tables "OpenAIChatCompletion_Usage_Info" and "OpenAIChatCompletion_Usage_Log")