Examples

Few examples to get you started

Enable CODE Authentication with OpenAI API Key

Users required to input access password to use the API, they can also using their own api key to use NextChat.

Variable NameValue
CODEpassword1
OPENAI_API_KEYsk_xxxxx

Enable OpenAI to all users who have access to your website

Variable NameValue
OPENAI_API_KEYsk_xxxxx

Using Azure as GPT Model Provider

Variable NameValue
AZURE_URLhttps://{azure-resource-url}/openai/deployments/{deploy-name}
AZURE_API_KEYazure_key_123456
AZURE_API_VERSION2022-06-01-preview

Using Google Gemini Pro as Model Provider

Variable NameValue
GOOGLE_API_KEYgoogle_key_123456

Avaliable Environment Variables

Variable NameRequiredDefault ValueDescriptionExample
CODEOptionalAccess password, separated by comma.password1,password2
OPENAI_API_KEYRequiredYour OpenAI API key, join multiple API keys with comma.key1,key2
BASE_URLOptionalhttps://api.openai.comOverride OpenAI API request base URL.http://your-openai-proxy.com
OPENAI_ORG_IDOptionalSpecify OpenAI organization ID.org-1234
AZURE_URLOptionalAzure deploy URL.https://{azure-resource-url}/openai/deployments/{deploy-name}
AZURE_API_KEYOptionalAzure API Key.azure_key_123456
AZURE_API_VERSIONOptionalAzure API Version, find it at Azure Documentation.2022-06-01-preview
GOOGLE_API_KEYOptionalGoogle Gemini Pro API Key.google_key_123456
GOOGLE_URLOptionalGoogle Gemini Pro API URL.https://googleapis.com/gemini/v1
HIDE_USER_API_KEYOptionalEmptyIf you do not want users to input their own API key, set this value to 1.1
DISABLE_GPT4OptionalEmptyIf you do not want users to use GPT-4, set this value to 1.1
ENABLE_BALANCE_QUERYOptionalEmptyIf you do want users to query balance, set this value to 1, or you should set it to 0.1
DISABLE_FAST_LINKOptionalEmptyIf you want to disable parse settings from URL, set this to 1.1
CUSTOM_MODELSOptionalEmptyTo control custom models, use + to add a custom model, use - to hide a model, use name=displayName to customize model name, separated by comma.+llama,+claude-2,-gpt-3.5-turbo,gpt-4-1106-preview=gpt-4-turbo