> ## Documentation Index
> Fetch the complete documentation index at: https://podonos.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# API Key Setup

> Learn how to set up your API key

## Background

In order to use the SDK, you first need to get the [API key](/docs/apikey) and set it properly.
There are two ways to set up your API keys.

## Direct use in your code

You can use your API key directly in your code.

```python python theme={null}
import podonos
from podonos import *

client = podonos.init(api_key="<YOUR_API_KEY>")
```

But, committing an API key to your code repository is a common vector for credential compromise.
So we strongly recommend the use of the environment variables as a proactive key safety measure.

<Warning>Please avoid commiting your API key to your code repository.</Warning>

## Add to environment variables

Set your API key as your environment variable.

### Linux / MacOS

Set your `PODONOS_API_KEY` environment variable on your shell command.
Run the following command in your terminal, replacing `YOUR_API_KEY` with your API key.

```bash theme={null}
export PODONOS_API_KEY="YOUR_API_KEY"
```

Once this is set, you can confirm that you have set your environment variable by using the following command.

```bash theme={null}
echo $PODONOS_API_KEY
```

Now, in your code, you can skip setting the `api_key` while initialization.

```python python theme={null}
import podonos
from podonos import *

client = podonos.init()
```

### Windows

Run the following in the cmd prompt, and replace `<YOUR_API_KEY>` with your API key.

```bash theme={null}
setx PODONOS_API_KEY "<YOUR_API_KEY>"

```

Once the variable is setup, you can validate that the variable has been set properly by opening a new
cmd prompt window and typing in

```bash theme={null}
echo %PODONOS_API_KEY%
```

All set! Let's use the SDK.
