> ## Documentation Index
> Fetch the complete documentation index at: https://private-04b27de1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.config_list_openai_aoai

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### config\_list\_openai\_aoai

```python theme={null}
config_list_openai_aoai(
    key_file_path: str | None = '.',
    openai_api_key_file: str | None = 'key_openai.txt',
    aoai_api_key_file: str | None = 'key_aoai.txt',
    openai_api_base_file: str | None = 'base_openai.txt',
    aoai_api_base_file: str | None = 'base_aoai.txt',
    exclude: str | None = None
) -> list[dict[str, Any]]
```

Get a list of configs for OpenAI API client (including Azure or local model deployments that support OpenAI's chat completion API).<br />This function constructs configurations by reading API keys and base URLs from environment variables or text files.<br />It supports configurations for both OpenAI and Azure OpenAI services, allowing for the exclusion of one or the other.<br />When text files are used, the environment variables will be overwritten.<br />To prevent text files from being used, set the corresponding file name to None.<br />Or set key\_file\_path to None to disallow reading from text files.<br />

<b>Parameters:</b>

| Name                   | Description                                                                                                                                                                           |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key_file_path`        | The directory path where the API key files are located.<br /><br />Defaults to the current directory.<br /><br />**Type:** str \| None<br /><br />**Default:** '.'                    |
| `openai_api_key_file`  | The filename containing the OpenAI API key.<br /><br />Defaults to 'key\_openai.txt'.<br /><br />**Type:** str \| None<br /><br />**Default:** 'key\_openai.txt'                      |
| `aoai_api_key_file`    | The filename containing the Azure OpenAI API key.<br /><br />Defaults to 'key\_aoai.txt'.<br /><br />**Type:** str \| None<br /><br />**Default:** 'key\_aoai.txt'                    |
| `openai_api_base_file` | The filename containing the OpenAI API base URL.<br /><br />Defaults to 'base\_openai.txt'.<br /><br />**Type:** str \| None<br /><br />**Default:** 'base\_openai.txt'               |
| `aoai_api_base_file`   | The filename containing the Azure OpenAI API base URL.<br /><br />Defaults to 'base\_aoai.txt'.<br /><br />**Type:** str \| None<br /><br />**Default:** 'base\_aoai.txt'             |
| `exclude`              | The API type to exclude from the configuration list.<br /><br />Can be 'openai' or 'aoai'.<br /><br />Defaults to None.<br /><br />**Type:** str \| None<br /><br />**Default:** None |

<b>Returns:</b>

| Type                          | Description                                                                                                                                                   |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| list\[dict\[str, typing.Any]] | List\[Dict]: A list of configuration dictionaries. Each dictionary contains keys for 'api\_key', and optionally 'base\_url', 'api\_type', and 'api\_version'. |

<br />
