> ## 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.oai.openai_utils.get_config

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

#### get\_config

```python theme={null}
get_config(
    api_key: str | None,
    base_url: str | None = None,
    api_type: str | None = None,
    api_version: str | None = None
) -> dict[str, Any]
```

Constructs a configuration dictionary for a single model with the provided API configurations.<br />Example:

```python theme={null}
config = get_config(api_key="sk-abcdef1234567890", base_url="https://api.openai.com", api_version="v1")
# The 'config' variable will now contain: <br/># \{
#     "api_key": "sk-abcdef1234567890",
#     "base_url": "https://api.openai.com",
#     "api_version": "v1"
# }
```

<b>Parameters:</b>

| Name          | Description                                                                                                                          |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `api_key`     | The API key for authenticating API requests.<br /><br />**Type:** str \| None                                                        |
| `base_url`    | The base URL of the API.<br /><br />If not provided, defaults to None.<br /><br />**Type:** str \| None<br /><br />**Default:** None |
| `api_type`    | The type of API.<br /><br />If not provided, defaults to None.<br /><br />**Type:** str \| None<br /><br />**Default:** None         |
| `api_version` | The version of the API.<br /><br />If not provided, defaults to None.<br /><br />**Type:** str \| None<br /><br />**Default:** None  |

<b>Returns:</b>

| Type                   | Description                                                    |
| ---------------------- | -------------------------------------------------------------- |
| dict\[str, typing.Any] | Dict: A dictionary containing the provided API configurations. |

<br />
