This commit is contained in:
ishaan-jaff 2023-09-12 10:07:40 -07:00
parent e5cd21d64b
commit e46dab5e92

View file

@ -1,14 +1,15 @@
# Setting API Keys, Base, Version
LiteLLM allows you to specify the following:
* API Key
* API Base
* API Version
* API Type
environment variables
setting litellm.api_key
setting litellm.<provider_name>_api_key (e.g. litellm.openai_api_key, litellm.anthropic_api_key, etc.)
passing in dynamically via completion() call - e.g. completion(..., api_key="...")
You can set the API configs using:
* Environment Variables
* litellm.api_key [litellm variables]
* Passing args to `completion()`
# Setting API Keys, Base, and Version
@ -16,6 +17,8 @@ API keys, base API endpoint, and API version can be set via environment variable
## Environment Variables
### Setting API Keys
Set the liteLLM API key or specific provider key:
```python
@ -28,6 +31,15 @@ os.environ["REPLICATE_API_KEY"] = "Your API Key"
os.environ["TOGETHERAI_API_KEY"] = "Your API Key"
```
### Setting API Base and API Version
```python
AZURE_API_BASE = "https://openai-gpt-4-test-v-1.openai.azure.com/"
AZURE_API_VERSION = "2023-05-15"
```
### Setting API Version
## Dynamic API Key
You can pass the API key within `completion()` call: