> For the complete documentation index, see [llms.txt](https://docs.cloud4.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud4.ai/sdk/configurations-and-env-variables.md).

# Configurations & Env Variables

## Introduction

To configure, test, and authenticate the C4AI SDK, environment variables are utilized. These variables enable the configuration of logging behavior, authentication, and other parameters crucial for debugging and development purposes.

## Environment Variables

### Mandatory

Mandatory environment variables are required for the SDK authentication process. If you're passing credentials directly or via the `c4ai.conf.json` file, these environment variables will be used in accordance with their priority.

> &#x20;**Note:**  Read more about credentials and configuration priority in the [Authentication](/sdk/authentication.md) section.&#x20;

| Variable             | Description                                |
| -------------------- | ------------------------------------------ |
| C4AI\_CLIENT\_ID     | Client ID for Cloud4.ai authentication     |
| C4AI\_CLIENT\_SECRET | Client secret for Cloud4.ai authentication |

### Configurable for Development

Using development parameters, you can configure the SDK behavior more effectively for debugging and testing purposes.

<table><thead><tr><th width="372">Variable</th><th width="143">Default Value</th><th>Description</th></tr></thead><tbody><tr><td>C4AI_SDK_CONFIG_VERBOSE</td><td></td><td>Enable verbose logging (true/false)</td></tr><tr><td>C4AI_SDK_CONFIG_IGNORE_ERRORS</td><td>true</td><td>Ignore errors during SDK execution (true/false)</td></tr><tr><td>C4AI_SDK_CONFIG_SDK_VALIDATION</td><td>true</td><td>Enable SDK validation (true/false)</td></tr></tbody></table>

### Configurable for Testing

If you need to run tests, you can additionally configure test environment variables, which can facilitate running tests directly on your services.

> &#x20;**Note:** `C4AI_SDK_API_LOCATION` may also be utilized in the case of a standalone Cloud4.ai installation.

| Variable                           | Description                                  |
| ---------------------------------- | -------------------------------------------- |
| C4AI\_SDK\_API\_LOCATION           | Location of the Cloud4.ai API for testing    |
| C4AI\_SDK\_TEST\_\_EES\_SIC        | SIC for EES (Execution Engine Service) tests |
| C4AI\_SDK\_TEST\_\_PL\_PROMPT\_SIC | SIC for PL Prompt tests                      |
| C4AI\_SDK\_TEST\_\_AAC\_SIC        | SIC for AAC (AI Automation Control) tests    |

## C4AI Config File

The `c4ai.conf.json` provides an alternative method to configure the C4AI SDK, allowing you to specify all variables and SDK behavior directly from a JSON configuration. This option is useful in cases where you want to replicate the same behavior in a development environment or for setting up the Frontend SDK.

The structure of the file mirrors that of environment variables:

```json
{
    "client_id": "YOUR_CLIENT_ID", // mandatory
    "client_secret": "YOUR_CLIENT_SECRET", // mandatory
    "sdk": {
        "verbose": true, // optional
        "ignoreErrors": false, // optional
        "ignoreWarnings": false, // optional
        "sdkValidation": true // optional
    },
    "apiLocation": "Path to your on-prem Cloud4.ai" // optional
}
```

> &#x20;**Note:** Test variables are not applicable for the configuration file.
