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

# autogen.config_list_from_models

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

#### config\_list\_from\_models

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

Get a list of configs for API calls with models specified in the model list.<br />This function extends `config_list_openai_aoai` by allowing to clone its' out for each of the models provided.<br />Each configuration will have a 'model' key with the model name as its value. This is particularly useful when
all endpoints have same set of models.<br />

<b>Parameters:</b>

| Name                  | Description                                                                                                             |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `key_file_path`       | The path to the key files.<br /><br />**Type:** str \| None<br /><br />**Default:** '.'                                 |
| `openai_api_key_file` | The file name of the OpenAI API key.<br /><br />**Type:** str \| None<br /><br />**Default:** 'key\_openai.txt'         |
| `aoai_api_key_file`   | The file name of the Azure OpenAI API key.<br /><br />**Type:** str \| None<br /><br />**Default:** 'key\_aoai.txt'     |
| `aoai_api_base_file`  | The file name of the Azure OpenAI API base.<br /><br />**Type:** str \| None<br /><br />**Default:** 'base\_aoai.txt'   |
| `exclude`             | The API type to exclude, "openai" or "aoai".<br /><br />**Type:** str \| None<br /><br />**Default:** None              |
| `model_list`          | The list of model names to include in the configs.<br /><br />**Type:** list\[str] \| None<br /><br />**Default:** None |

<b>Returns:</b>

| Type                          | Description                                                                     |
| ----------------------------- | ------------------------------------------------------------------------------- |
| list\[dict\[str, typing.Any]] | list: A list of configs for OpenAI API calls, each including model information. |

<br />
